Skip to content

GetPlayerById

Read player by id from current game state.

GetPlayerById(playerId)

Inputs: playerId is an integer game player ID.

Output: Player, or nil.

Errors and unavailable states: Wrong argument types can raise a Lua argument error. Unavailable game data or an invalid target returns nil as described in Output.

See Game data and world for related calls and usage notes.