Returns the script instance that a thread belongs to, or nil if the thread is not tied to a game script. This is the inverse of getscriptthread.

Parameters

thread
required
The thread to map back to a script.

Returns

Instance or nil
The owning script, or nil.

Example