Yuari
Documentation
Docs/Actors/run_on_actor

run_on_actor

Runs Luau source on an actor.

Syntax

run_on_actor(actor: Instance, source: string, ...) -> nil

Parameters

ParameterTypeDescription
actorInstanceThe actor instance that should run the operation.
sourcestringLuau source code to compile or execute.
......Additional arguments forwarded to the target.

Returns

TypeDescription
nilThis function does not return a value.

Description

run_on_actor is part of the Actors library. Actor helpers target Roblox's parallel actor scheduler. Code sent to an actor runs in that actor's isolated Luau context rather than the current script thread.

The operation is performed immediately using the arguments supplied at the call site.

The aliases run_on_actors(...) resolve to the same implementation.

Example

local actor = getactors()[1]
run_on_actor(actor, [[print("running from actor")]])

Notes

  • Aliases: run_on_actors(...).
  • Actor calls run in a separate parallel state; data passed into the actor must be representable in Luau.