VINDICTA.TOP
Actors · Function Unregistered
Bunni.fun
ChocoSploit
Cryptic
Potassium
Seliware
SirHurt
Solara
Velocity
Volcano
Volt
Wave
Xeno

run_on_actor

Runs code inside an actor's global state.

Unregistered
This function is not registered within sUNC, your executor may/may not have this.
function run_on_actor(actoractorActor?The actor to execute code inside of. Nil runs in the default state.: Actor?, scriptscriptstringThe Luau source code to execute.: string, channel_datachannel_dataany?Data passed as ... to the script. Cannot be tables or functions (different Lua VM).?: any): ()

Usage

Simple execution
run_on_actor(getactors()[1], 'print("Hello World!")')
Transfer data via comm channel
local comm_id, event = create_comm_channel()
event.Event:Connect(function(data)
    print(data) -- -> Hello World!
end)
run_on_actor(getactors()[1], [=[
    local channel = get_comm_channel(...)
    channel:Fire('Hello World!')
]=], comm_id)