线程

getscriptfromthread

返回与线程关联的脚本。

语法

getscriptfromthread(thread: thread): Instance | nil

参数

名称类型描述
threadthread线程要检查或运行在里面。

返回值

名称类型描述
scriptInstance | nil与上下文关联的脚本实例,或者为零。

说明

返回与线程关联的脚本。

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

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

示例

使用占位值的示例调用。

local result = getscriptfromthread(coroutine.running())
print(result)