I have a script that I want to run five minutes into the game. What is the best way to do this? Should I just use
wait(300)
Is there no better option?
I have a script that I want to run five minutes into the game. What is the best way to do this? Should I just use
wait(300)
Is there no better option?
Theres nothing wrong with Wait(300) that I can think of?
If you don’t want the entire script to halt you can use delay instead.
task.wait(300) should be used or a custom wait
wait() is deprecated
you should use task.delay() instead of delay()
If you want to be completely accurate, you can use tick(). For example:
local waittime = tick() + 300
repeat task.wait()
until (tick() >= waittime)
print("done!")
Thank you everyone! I learned a lot from this post.
You shouldn’t need to do this. Both will resume on heartbeat after 300 seconds have elapsed.
Ooh, nice! The new task library is even better than I thought.