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.
Syntax
Section titled “Syntax”GetPlayerState(key [, pid])| Parameter | Type | |
|---|---|---|
pid |
number | the player; nil = yourself (optional) |
key |
string | the key |
Returns
Section titled “Returns”string | nil
Example
Section titled “Example”local myTeam = GetPlayerState(nil, "team")local theirs = GetPlayerState(pid, "team")See also
Section titled “See also”GetPlayerStates · GetPlayerId · OnStateChange · the State bags group of the index
