spawn
Run a block on a new thread. Emits task.spawn.
Syntax
Section titled “Syntax”spawn { task::wait(2); post("Delay finished!");};Parameters
Section titled “Parameters”None.
Return value
Section titled “Return value”None (fires and forgets).
Luau emit
Section titled “Luau emit”task.spawn(function() … end)
Description
Section titled “Description”The block is a body, not a callback you pass. For Parallel Luau, see parallel.
Example
Section titled “Example”spawn { task::wait(2); post("Delay finished!");};Emits:
task.spawn(function() task.wait(2) print("Delay finished!")end)