"Pause" Code Until Critera is Met?

wait(var : number) is a different function entirely from Event:Wait() which is worth knowing. wait() is subject to be deprecated at any point in time in favor of task scheduler yielding. They just share the same name because they exist in differing packages/source containers within Roblox top-level libraries which means that the names do not clash.

Additionally, wait(var : number) immediately indexes for easy access, whereas task scheduler yields from task library (and should be used over wait()).

print(task)

--[[
                    ["defer"] = "function",
                    ["delay"] = "function",
                    ["desynchronize"] = "function",
                    ["spawn"] = "function",
                    ["synchronize"] = "function",
                    ["wait"] = "function"
]]
2 Likes