Skip to content
Scripts & runtimeOverview

getscriptfromthread

Finds script metadata associated with a thread.

Details#

Resolves the script object associated with a thread, or nil when the thread has no discoverable script. A plain coroutine is a thread even without script metadata.

Examples#

Example

Luau
local thread = coroutine.create(function() end)
local object = getscriptfromthread(thread)
print(object and object.Name or "No associated script")