ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client events
  3. onClientElementDataChange

Event

onClientElementDataChange

New event!Added to Trilogy Hub on 3 Nov 2026.

ClientElementsIdentical to MTA:SA

An element's data changed - through setElementData on the server or in a client script.

Handler

addEventHandler("onClientElementDataChange", root, function(key, oldValue, newValue) ... end)

Parameters

keystring
Key name.
oldValueany
Previous value (nil when the key did not exist).
newValueany
New value (nil after the key was removed).

Source

source is the element whose data changed.

Example

addEventHandler("onClientElementDataChange", localPlayer, function(key, old, new)
    if key == "money" then outputChatBox("Pieniądze: " .. tostring(new)) end
end)

See also