Scripting/Client/Classes/Element_data_v0_5_3
player, vehicle, object, pickup and sphere (checkpoints too) have GetElementData(key): the values the server set with SetElementData(key, value) (synced, the default). Values the server set with sync = false are not visible here. SetElementData(key, value) and RemoveElementData(key) also exist on the client but only change your own copy - nothing is sent to the server, and the next server value for that key replaces it.
function onClientElementDataChange(element, key)
{
if (key == "rank" && element == FindLocalPlayer())
Message("Your rank is now " + element.GetElementData("rank"));
}Methods and functions
- onClientElementDataChange – Fires when the server sets or removes a synced value.
Categories: Client classes