ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. sleep

Function

sleep

Server and clientTimersTrilogy Hub only

Pauses an async task for the given time. Meanwhile other scripts, the server and the game run normally. sleep(0) waits until the next server frame (the same as setTimer with interval 0).

Syntax

bool sleep(int ms)

Arguments

msint
Time in milliseconds.

Returns

true after the time has passed.

Example

async(function()
    outputChatBox("Za 2 sekundy pojawi się napis")
    sleep(2000)
    outputChatBox("Gotowe")
end)

Notes

Only inside a task. Outside async it raises an error instead of freezing the whole server.

See also