> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# getrunningscripts

> Returns a new array table of unique script Instances taken from live Lua threads. The function takes no arguments. It walks the live Luau thread list, reads each thread node, skips entries without a thread node, without a weak thread ref, without LiveLuaRef, without a Lua state, without object, or with an expired Script stored reference. For each remaining thread, it locks scriptThread->object->Script(), deduplicates by the script reference, pushes the Instance with Instance cache, and inserts it at sequential array indexes starting at 1. The function does not scan the DataModel, does not check ClassName, and does not sort the result.

Returns a new array table of unique script Instances taken from live Lua threads. The function takes no arguments. It walks the live Luau thread list, reads each thread node, skips entries without a thread node, without a weak thread ref, without LiveLuaRef, without a Lua state, without object, or with an expired Script stored reference. For each remaining thread, it locks scriptThread->object->Script(), deduplicates by the script reference, pushes the Instance with Instance cache, and inserts it at sequential array indexes starting at 1. The function does not scan the DataModel, does not check ClassName, and does not sort the result.

## Syntax

```lua theme={null}
getrunningscripts(): table
```

## Returns

| Name      | Type    | Description                                                                               |
| --------- | ------- | ----------------------------------------------------------------------------------------- |
| `scripts` | `table` | New array table of unique script Instance object values associated with live Lua threads. |
