Skip to main content
Returns the main thread associated with a given script. The inverse of getscriptfromthread — useful for interacting with or inspecting the thread a script is running on.

Parameters

Returns

thread? - the coroutine thread associated with the given script, or nil if the script is not currently running.

Example

Provides direct access to the coroutine of a script, which is helpful when monitoring script execution or state.