getactorstates

Returns LuaStateProxy objects for active Actors.

Syntax

getactorstates() -> {LuaStateProxy}

Returns

TypeDescription
{LuaStateProxy}Array of Actor Lua states

Description

Use getgamestate() when you need the game state instead.

Example

local states = getactorstates()
print("Total Lua states:", #states)

for i, state in ipairs(states) do
    print(i, "State ID:", state.Id, "Is Actor:", state.IsActorState)
end

Filter Actor States

local states = getactorstates()
local actorStates = {}

for _, state in ipairs(states) do
    if state.IsActorState then
        table.insert(actorStates, state)
    end
end

print("Actor states:", #actorStates)