Skip to content

KcdMp.state

The bags - global, per player, per entity - as tables of strings.

KcdMp.state.global[key] is the world’s bag; KcdMp.state.player[pid][key] a player’s (every player’s, from the join on; the client’s own pid is KcdMp.player_id); KcdMp.state.entity[id][key] an entity’s while it is in view. A player’s table appears with their first key and goes with their leave; read KcdMp.state.player[pid] defensively.

KcdMp.state

table - {global = {key = value}, player = {[pid] = {key = value}}, entity = {[id] = {key = value}}}

local round = tonumber(KcdMp.state.global.round) or 0
local mine = KcdMp.state.player[KcdMp.player_id]
local team = mine and mine.team

KcdMp.on_state · KcdMp.on_state_change · KcdMp.player_id · the State bags group of the index