async.wait
Shared
Pauses the current async thread for ms milliseconds. The rest of the game keeps running.
nil|false async.wait(float ms)
Parameters
| Name | Type | Description |
|---|---|---|
| ms | float | Milliseconds to pause. A negative value counts as 0. |
Returns
Nothing when the thread resumes. Only works inside an async thread. Outside one, it logs an error and returns false.
Example
async.thread(function()
while true do
outputDebugString("players online: " .. #getElementsByType("player"))
async.wait(60000)
end
end)