run_on_actor
Schedules source code in a VM selected by a Actor.
The source is compiled and scheduled on an executor thread in the target VM. It does not synchronously return the chunk's results or resume the supplied thread at its previous instruction. Cross-VM values must be supported by the value copier.
run_on_actor(target: Actor, source: string, ...: any): ()Parameters
| Parameter | Type | Description |
|---|---|---|
target | Actor | Target Actor or thread. |
source | string | Luau source compiled in the target VM. |
... | any | Arguments copied to the target chunk. |
Example
local function runExample(target)
run_on_actor(target, "local value = ...; print(value)", "example")
endExample output
exampleThe chunk runs in the actor's VM, so the print is routed through that VM's output channel.
Errors: Missing or foreign target VMs, unsupported argument copies and compilation/scheduling failures raise errors.
Aliases: runonactor.
