When I’m trying use wait() and task.wait(), I’m don’t see any difference between them. When I’m go to Developer page about task, I’m don’t understand what they mean. Can someone explain me what’s difference between this two wait()?
wait() is about to go deprecated
task.wait() is more accurate than wait()
Like someone else mentioned, task.wait
is just faster and better, I am pretty sure ( correct me if I am wrong ) that is is equivalent to using RunService.HeartBeat:Wait()
.
the function wait
is just bad practice nowdays, I never used wait
again ever since I discovered task.wait()
task.wait() is essentially just wait but based in roblox’s heartbeats
ex. wait() can only go to wait(1/30) while task.wait() is dependant on fps, so you can go up to task.wait(1/60) or higher if the user is using fpsunlocker
My only peev about the new task.wait is they have made it longer. Now we have to type 5 extra characters…
As other replies said already, task.wait is essentailly twice as fast if you provide no number in the brackets (it waits 1 frame)
Though be careful, as doing a loop like this:
while true do
task.wait()
-- do something
end
It will continue to run even when the script is disabled/destroyed
(this is a bug, it will be fixed soon)