Do functions that are called inside of a while true do loop affect the progress of the loop? For instance
function waitFunction() wait(5) print("function") end
while true do wait(1) print("loop") waitFunction() end
will waitFunction keep the loop from proceeding until it's done?
and if so, how do I avoid that from happening?
thanks!
There are a few ways. The first way is the use Coroutines
, second Option is to use the Delay
function, and last is to use the Spawn
Function. I'm familiar with all of these, but I'm best at using Delay, so that's what I'll be using.
function waitFunction() print("function") end while true do wait(1) print("loop") delay(5,waitFunction) end
Here's the link to where you can learn more about delay.
Good Luck!