task

Provides an interface to interact with the Lua scheduler

Summary

task.wait(sec: number?): number
task.spawn(callback: () -> ())
task.delay(sec: number, callback: () -> ())
task.isyieldable(): boolean

Methods

task.wait()

Yields the current coroutine for the set amount of time

task.wait(sec: number?): number

task.spawn()

Spawns a new coroutine

task.spawn(callback: () -> ())

task.delay()

Schedules a new coroutine that resumes after a set amount of time

task.delay(sec: number, callback: () -> ())

task.isyieldable()

Whether or not the coroutine is able to yield

task.isyieldable(): boolean