I am sure you can make global functions by using _G, but how do you make global coroutines?
local function WaitAndPrint() for i = 10, 0, -1 do print(i) wait(1) end end _G.WaitAndPrint = coroutine.create(WaitAndPrint)
And in another script...
wait(1) coroutine.resume(_G.WaitAndPrint)
Just use a BindableFunction
. You can use the OnInvoke callback to fire a function when the BindableFunction is invoked, then you can invoke the BindableFunction in a coroutine.
More information: