SetSavedData
Saves a value on the player’s name - it is there on their next visit.
Strings (a number is converted); nil removes the key. Written into the player’s record with the visits and the position;
for a registered name, only when its owner is logged in.
Syntax
Section titled “Syntax”SetSavedData(pid, key, value)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
key |
string | the key |
value |
string | nil | the value; nil removes the key |
Returns
Section titled “Returns”boolean - false when not connected
Example
Section titled “Example”function OnPlayerDeath(pid, attacker) if attacker >= 0 then SetSavedData(attacker, "wins", (tonumber(GetSavedData(attacker, "wins")) or 0) + 1) endendSee also
Section titled “See also”GetSavedData · GetSavedPlayer · SetServerData · the Storage and persistence group of the index
