task.wait
Yields for seconds (default 0.03).
Syntax
task.wait(seconds?: number) -> any
Parameters
| Parameter | Type | Description |
|---|---|---|
seconds? | number | A duration in seconds. |
Returns
| Type | Description |
|---|---|
any | Yields |
Description
task.wait is part of the task library library. The task library runs on the VM's own scheduler; waits and delayed callbacks resume when the VM next ticks.
The calling thread yields as needed and resumes on the module scheduler when the operation completes.
Example
task.wait(0.5)
Notes
- Waits and delayed callbacks resume on the VM's scheduler.