removeElementData
Shared
Deletes a piece of data kept on an element.
bool removeElementData(element element, string key)
Parameters
| Name | Type | Description |
|---|---|---|
| element | element | The element. |
| key | string | The data's name. Keys over 128 characters are cut, with a warning. |
Returns
true if it was deleted, false if there was no data under that key or a handler cancelled the change.
Fires onElementDataChange (on the server) or onClientElementDataChange (on a client) with a new value of nil. On the server, cancelling the event keeps the data; the removal reaches the players who were receiving that data.
Example
addEventHandler("onPlayerSpawn", root, function()
removeElementData(source, "wanted")
end)