Knowing that wait() will soon get depricated and that task.wait() is a straight upgrade to it, I figured I could replace all the wait()s that are in my game, including the ones that exist in default scripts with task.wait(.
I took into consideration the way to replace only wait( using this regex (?<![:.a])wait\(.
task.wait() is the same as RunService.Heartbeat:Wait(), meaning it can run about 60 times a second, which is much faster than wait() with nothing in it. Make sure you don’t have any loops with nothing inside the wait that would cause lots of lag from running so fast.
You should also replace all “delay()” and “spawn()” occurences with “task.delay()” and “task.spawn()” respectively.
1 Like
Simple answer is yes, only problem I ran into was with the Animate default script, the wait() at the last lines shouldn’t be changed to task.wait(), other than that, it’s 100% good.