‹ All natives
Namespace: TIME
API set: server
Language: Luau Improve
wait
wait(seconds: number?)
Suspends the current function.
Parameters#
- seconds (
number, optional): duration. 0: resumes on the next tick
Example#
on("playerJoin", function(player)
wait(3)
if player:exists() then
player:emit("welcome")
end
end)
Notes#
- Usable in event handlers, zones,
after, every and thread.
- At the top level of
main.luau, wrap it in thread.
- Precision is that of the tick: 50 ms at 20 ticks per second.