Skip to content

GetPlayerState

One key of a player’s bag.

Every player’s bag is here from their join on; pid nil is your own. Gone with the player’s session.

GetPlayerState(key [, pid])
Parameter Type
pid number the player; nil = yourself (optional)
key string the key

string | nil

local myTeam = GetPlayerState(nil, "team")
local theirs = GetPlayerState(pid, "team")

GetPlayerStates · GetPlayerId · OnStateChange · the State bags group of the index