Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can I make a global coroutine?

I am sure you can make global functions by using _G, but how do you make global coroutines?

2 answers

✓ Accepted answer
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)

This discussion is preserved as it was. New answers, comments, and votes are closed.