GetSavedPlayer
What the server remembers about the player’s name between visits.
The record the server keeps by itself: how many visits, the seconds played, and the last position - refreshed on the
disconnect and every minute (x, y, z, yaw are absent until the first visit ended). nil when the name has no
record yet. A registered name’s record is written for its owner only: a guest who typed the name reads nothing and
leaves no trace. Persistence is [persistence] file in server.toml; names are case-insensitive.
Syntax
Section titled “Syntax”GetSavedPlayer(pid)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
Returns
Section titled “Returns”table - {visits=, playTime=, x=, y=, z=, yaw=} (the position absent on a first visit); nil without a record
Example
Section titled “Example”function OnPlayerRequestSpawn(pid) local saved = GetSavedPlayer(pid) if saved and saved.x then SetSpawnInfo(pid, saved.x, saved.y, saved.z, saved.yaw) end -- back where they left return trueendSee also
Section titled “See also”GetSavedData · SetSavedData · OnPlayerConnect · the Storage and persistence group of the index
