LuaStateProxy.Id
Unique identifier for this Lua state.
Syntax
state.Id: number?Description
LuaStateProxy.Id is the read-only identifier for the Lua state.
Example
local state = getluastate()
print("State ID:", state.Id)Compare States
local gameState = assert(getgamestate(), "Game state is not available")
local currentState = getluastate()
if gameState.Id == currentState.Id then
print("Running on game state")
else
print("Running on different state (ID:", currentState.Id, ")")
endTrack States
local states = getactorstates()
local stateIds = {}
for _, state in ipairs(states) do
table.insert(stateIds, state.Id)
print("State ID:", state.Id, "Is Actor:", state.IsActorState)
endRelated Properties
LuaStateProxy.IsActorState- Check if state is for actorsLuaStateProxy.Event- Communication event