Learn
Engine Library
task

Summary
Functions
spawn(functionOrThread: function | coroutine,...: Variant):coroutine
defer(functionOrThread: function | coroutine,...: Variant):coroutine
delay(duration: number,functionOrThread: function | coroutine,...: Variant):coroutine
wait(duration: number):number
cancel(thread: coroutine):()

API Reference
Functions
spawn
task.spawn(
functionOrThread:function | coroutine, ...:Variant
Parameters
functionOrThread:function | coroutine
...:Variant
Returns

defer
task.defer(
functionOrThread:function | coroutine, ...:Variant
Parameters
functionOrThread:function | coroutine
...:Variant
Returns

delay
task.delay(
duration:number, functionOrThread:function | coroutine, ...:Variant
Parameters
duration:number
functionOrThread:function | coroutine
...:Variant
Returns

desynchronize
task.desynchronize():()
Returns
()

synchronize
task.synchronize():()
Returns
()

wait
task.wait(duration:number):number
Parameters
duration:number
Default Value: 0
Returns

cancel
task.cancel(thread:coroutine):()
Parameters
thread:coroutine
Returns
()

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.