I have a function with multiple wait functions that is called by another function. However, I want the second function to be able to work right away instead of waiting for the function it calls. Is there any way to do this?
Thank you!
I have a function with multiple wait functions that is called by another function. However, I want the second function to be able to work right away instead of waiting for the function it calls. Is there any way to do this?
Thank you!
You could use the spawn function
spawn(function()
wait(3)
print"Waited"
end)
print"this will print first"
You could also use a coroutine.
coroutine.wrap(function()
wait(3)
print"waited"
end)()
--coroutine.wrap returns a function, so we call it here.
print"this will print first"
This discussion is preserved as it was. New answers, comments, and votes are closed.