脚本

getscriptthread

当脚本可用时,返回与脚本关联的线程。

语法

getscriptthread(script: userdata): thread | nil

参数

名称类型描述
scriptuserdata要检查的脚本或 ModuleScript 实例。

返回值

名称类型描述
threadthread | nil与脚本关联的线程,或者为零。

说明

当脚本可用时,返回与脚本关联的线程。

使用 1 个参数调用: script。参数表会说明哪些值必填,哪些值只用于细化行为。

返回 thread (thread | nil)。使用返回表区分成功值、nil 结果和可恢复错误。

示例

使用占位值的示例调用。

local result = getscriptthread(game)
print(result)