getgamestate
Returns the proxy for the main game’s Luau state.
Syntax
getgamestate() -> LuaStateProxy
Also available as
get_game_state
Returns
| Type | Description |
|---|---|
LuaStateProxy | Proxy for the main game state. |
Description
A proxy describes a state and exposes Execute and GetActors. It is not a raw lua_State pointer or a coroutine. Use its methods rather than treating it as a table of the game’s globals. State proxies belong to the joined game and become stale after reconnecting.
Example
local state = getgamestate()
print(state.Id, state.IsActorState)
These are Game executor contracts. Check build requirements and session lifetimes before using them.
