run_on_actor
Runs a Luau source string in the given actor's own state. Every argument after the source is passed to the script and reaches it as ... .
Signature
run_on_actor(actor: Actor, source: string, ...any): ()Parameters
actorActorThe actor whose state runs the code, for example one of the results of getactors.
sourcestringLuau source to run. It is a separate state, so none of your locals are visible to it.
......anyValues handed to the script. Several can be passed, and tables are accepted.
Returns
Nothing.
Note
Example
local actor = getactors()[1]
run_on_actor(actor, [[
local data, a, b = ...
print(data.name, a + b, data.target == workspace) --> saiko 3 true
]], { name = "saiko", target = workspace }, 1, 2)