Actors

getactorthreads

Returns an array table of Luau threads from the actor thread list.

Syntax

getactorthreads(): {thread}
Aliases getactorstates

Returns

NameTypeDescription
threads{thread}Array table of actor Luau thread values pushed as Luau threads.

Description

Returns an array table of Luau threads from the actor thread list. The function takes no arguments. It reads the actor list bounds from ScriptContext, walks each actor state entry, decrypts the stored global state into a Luau thread, and includes only entries that are valid threads.

Call it without parameters. The function reads the needed context from the current runtime state.

It returns threads ({thread}). Use the returns table to separate successful values from nil results and recoverable errors.

Example

List Luau threads from the ScriptContext actor state list.

for _, thread in ipairs(getactorthreads()) do
    print(thread)
end