I've seen this a lot, does anyone know how it works??
function Spawner(func, ...)
local co = coroutine.wrap(func)
co(...)
end)
It looks confusing
I've seen this a lot, does anyone know how it works??
function Spawner(func, ...)
local co = coroutine.wrap(func)
co(...)
end)
It looks confusing
Hello, CaIcuIati0n!
That code does the same thing as the Spawn() function, wich is running code on a different thread.
Some links that might be useful:
https://developer.roblox.com/en-us/articles/Threading-Code
Comparation: Courintines vs Spawn
local courotines = coroutine.create(function()
While true do Print(1) Wait() End End()
Coroutine.resume(courotines) While true do Print(2)
End
This would print 1 and 2 at the same time it helps if you wanna do stuff after a loop
Did not help, or correlate to my question,
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
thank you!!!!