Yuari
Documentation
Docs/Script/getscriptfromthread

getscriptfromthread

Returns the script that owns a Lua thread.

Syntax

getscriptfromthread(thread: thread) -> Instance

Parameters

ParameterTypeDescription
threadthreadThe Luau thread to inspect.

Returns

TypeDescription
InstanceThe script that owns a Lua thread

Description

getscriptfromthread is part of the Script library. Script helpers inspect scripts loaded by the client, their bytecode and the Luau threads created for them.

The call is read-only: it resolves the current value when invoked and does not change the underlying state.

Example

local script = getscripts()[1]
print(getscriptfromthread(getscriptthread(script)))

Notes

  • Script data reflects the client's live script objects and may change after execution.