M MY Multiplayer: Wiki
Side
Kind

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

NameTypeDescription
msfloatMilliseconds 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)

See also