SetGlobalState
Sets a key of the world’s bag, read by every client.
Syntax
Section titled “Syntax”SetGlobalState(key, value)| Parameter | Type | |
|---|---|---|
key |
string | 1-48 characters |
value |
string | number | boolean | nil | kept as a string; nil removes the key |
Returns
Section titled “Returns”boolean - false when the key or the value is out of bounds or the bag is full
Example
Section titled “Example”SetGlobalState("round", 3) -- KcdMp.state.global.round == "3" on every clientSetGlobalState("flag_carrier", GetPlayerName(pid))SetGlobalState("flag_carrier", nil) -- removedSee also
Section titled “See also”GetGlobalState · GetGlobalStates · SetPlayerState · SetEntityState · the State bags group of the index
