學習
引擎資料庫
task

*此內容是使用 AI(Beta 測試版)翻譯,可能含有錯誤。若要以英文檢視此頁面,請按一下這裡


概要
函式
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 參考
函式
spawn
task.spawn(
functionOrThread:function | coroutine, ...:Variant
參數
functionOrThread:function | coroutine
...:Variant
返回

defer
task.defer(
functionOrThread:function | coroutine, ...:Variant
參數
functionOrThread:function | coroutine
...:Variant
返回

delay
task.delay(
duration:number, functionOrThread:function | coroutine, ...:Variant
參數
duration:number
functionOrThread:function | coroutine
...:Variant
返回

desynchronize
task.desynchronize():()
返回
()

synchronize
task.synchronize():()
返回
()

wait
task.wait(duration:number):number
參數
duration:number
預設值:0
返回

cancel
task.cancel(thread:coroutine):()
參數
thread:coroutine
返回
()

©2026 Roblox Corporation、Roblox、Roblox 標誌及 Powering Imagination 是我們在美國及其他國家地區的部分註冊與未註冊商標。