getactors
Returns a list of actors that you can execute code inside of.
function getactors(): table<number, Actor>Synopsis
How it works
Returns all
Actor instances currently present in the game’s DataModelDataModelThe root Instance in Roblox's object hierarchy (game). Contains all services (Workspace, Players, ReplicatedStorage, etc.). Teleporting destroys the current DataModel and creates a new one.. Actors are Roblox’s parallel execution containers — each Actor runs its scripts on a separate Luau VMLuau VMThe Luau Virtual Machine — a register-based bytecode interpreter. Executes compiled Luau instructions sequentially, managing a value stack, call stack, and upvalue chains. Roblox runs one VM per Actor context. thread, enabling true multi-threaded execution. This function provides discovery of all Actor containers.Parallel Luau
Roblox’s Parallel LuauParallel LuauRoblox's threading model that allows multiple Luau scripts to run concurrently in isolated Actor contexts. Actors have separate lua_States and can only share data through message channels. system assigns each Actor its own
lua_State. Scripts inside Actors can use task.desynchronize() to run in parallel. The executor’s Actor APIs let you inject code into these parallel contexts.Usage
Iterate actors
for index, actor in getactors() do
print(index, actor)
endReturns
table<number, Actor> An array of Actor instances available for code execution.