getthreads
Returns threads associated with a script or state.
Syntax
getthreads(script?: Instance) -> table
Parameters
| Parameter | Type | Description |
|---|---|---|
script? | Instance | The script value used by the call. |
Returns
| Type | Description |
|---|---|
table | Threads associated with a script or state |
Description
getthreads is part of the Instances library. Instance helpers traverse the live DataModel and return instance proxies tied to the current game session.
The call is read-only: it resolves the current value when invoked and does not change the underlying state.
Example
for _, thread in ipairs(getthreads()) do
print(thread)
end
Notes
- Returned instances are live proxies; they can become invalid if the object is destroyed.