- Documentation
- Server events
- onElementDataChange
Event
onElementDataChange
An element's data changed (setElementData or removeElementData), also from a client.
Handler
addEventHandler("onElementDataChange", root, function(theKey, oldValue, newValue) ... end)Parameters
theKeystring- The key.
oldValuemixed- The previous value (
falseif there was none). newValuemixed- The new value (
falseafterremoveElementData).
Source
source is the element.
Example
Protection: a client cannot change money by itself.
addEventHandler("onElementDataChange", root, function(key, old)
if key == "pieniadze" and client then
setElementData(source, key, old)
end
end)