onClientElementDataChange
ClienteEvento
Se dispara cuando un dato de un elemento cambia o se elimina. Cancelar el evento no deshace el cambio: el dato de este cliente se queda con el nuevo valor.
addEventHandler("onClientElementDataChange", root, function(string key, any oldValue, any newValue) … end)
Parámetros del handler
| Nombre | Tipo | Descripción |
|---|---|---|
| key | string | Nombre del dato. |
| oldValue | any | Valor anterior, o nil si la clave no existía. |
| newValue | any | Nuevo valor, o nil si el dato se eliminó. |
Source
El elemento cuyo dato cambió.
También se dispara cuando llega un dato sincronizado por el servidor.
Ejemplo
addEventHandler("onClientElementDataChange", localPlayer, function(key, oldValue, newValue)
if key == "money" then
outputDebugString("money: " .. tostring(oldValue) .. " -> " .. tostring(newValue))
end
end)