Skip to content

SetGlobalState

Sets a key of the world’s bag, read by every client.

SetGlobalState(key, value)
Parameter Type
key string 1-48 characters
value string | number | boolean | nil kept as a string; nil removes the key

boolean - false when the key or the value is out of bounds or the bag is full

SetGlobalState("round", 3) -- KcdMp.state.global.round == "3" on every client
SetGlobalState("flag_carrier", GetPlayerName(pid))
SetGlobalState("flag_carrier", nil) -- removed

GetGlobalState · GetGlobalStates · SetPlayerState · SetEntityState · the State bags group of the index