Skip to main content
Runs a string of Luau code inside the context of a given Actor.
An Actor is a Roblox object that can run code on its own, separate from your script. run_on_actor takes that actor and a string of Luau code, and runs the code on the actor. The trailing ... values are passed in as arguments. Most commonly used to push work into an Actor’s own Luau context, which is what multi-threaded scripts need when they can’t share one state. The actor runs in a separate Lua state, so shared and _G don’t cross between it and the calling script - each side has its own. Pass any value the code needs through the ... varargs instead.

Parameters

Returns

void

Example

Always check parameters and return values when working with this library function.