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

How to make a script not yield for a function?

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!

1 answer

✓ Accepted answer

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.