getscriptfromthread
Reads a thread's associated script.
Syntax
Signature
getscriptfromthread(Thread: thread) -> anyAliases
This function has no aliases.
Parameters
| Parameter | Type | Description |
|---|---|---|
Thread | thread | Lua thread whose global environment should be read. |
Returns
| Type | Description |
|---|---|
any | Environment script value, or nil. |
Notes
Reads the raw script field from Thread's global environment. It does not inspect the thread's stack frames.
Example
Luau
local Result = getscriptfromthread(coroutine.running())
print(Result)