getgamestate Synchronous
Get a proxy for the active game Luau state. Use it when you need to distinguish the main game state from Actor states.
Luau
getgamestate() -> LuaStateProxy?Parameters
This function takes no arguments.
Returns
LuaStateProxy?A LuaStateProxy for the game state, or nil when no active game state is available.
Luau
LuaStateProxy = {Id: number, IsActorState: boolean, Event: NativeSignal}Example
Luau
local gameState = getgamestate()
if gameState then
print("Game state ID:", gameState.Id)
end