Skip to content
AEOWUN
Docs Menu

Waiting

Pause a script and continue where it stopped.

Pause for a time

debug.log("Starting")
wait(1.0)
debug.log("One second later")

The duration is in seconds. The rest of the game keeps running.

Wait inside a function

fn delayed_message() {
    wait(0.5)
    debug.log("Ready")
}
delayed_message()

The function resumes after the pause. Its local values remain available.

Check objects again

Objects can be removed while a script waits. Before using a stored handle, check that the object still exists. Disabling the script cancels its active work. It will not resume the paused call. See Script control.

Reference

See wait(seconds) for valid durations. Prefer events when you are waiting for an action rather than a timer.

[BETA] marks features newer than the current public release. Current release: 0.8.0.