AcediaDocumentation

run_on_thread

Schedules source code in a VM selected by a thread.

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_thread(target: thread, source: string, ...: any): ()

Parameters

ParameterTypeDescription
targetthreadTarget Actor or thread.
sourcestringLuau source compiled in the target VM.
...anyArguments copied to the target chunk.

Errors: Missing or foreign target VMs, unsupported argument copies and compilation/scheduling failures raise errors.

Aliases: runonthread.

On this page