Volt

getactorstates

Returns all active LuaStateProxy objects.

Syntax

getactorstates() -> {LuaStateProxy}

Returns

TypeDescription
{LuaStateProxy}Array of all active LuaStateProxy objects

Description

getactorstates returns all active LuaStateProxy objects in the game. This includes both actor states and the main game state. Each LuaStateProxy represents a unique Lua execution environment.

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)

On this page