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

# getscripts

Returns every LocalScript and ModuleScript the executor is tracking in the current Roblox session.

```luau theme={null}
getscripts(): {LocalScript | ModuleScript}
```

Most commonly used to iterate every script in the place for a `decompile` sweep, or to find a specific script by name without knowing its path.

## Returns

`{LocalScript | ModuleScript | Script}` - an array of script Instances. CoreScripts are not included. Each call returns a fresh table - edits don't carry between calls.

## Example

<CodeGroup>
  ```luau Example 1 theme={null}
  <<<<<<< HEAD
  local scripts = getscripts()
  =======
  -- getscripts(): {LocalScript | ModuleScript}
  >>>>>>> 50e30f53759b0538759af25c9b271514aa2c9290
  ```

  ```luau Example 2 theme={null}
  for _, script in ipairs(getscripts()) do
      if script:GetFullName():find("marker") then
          print(`{script.ClassName}: {script:GetFullName()}`)
      end
  end
  ```
</CodeGroup>

<Tip>
  Always check parameters and return values when working with this library function.
</Tip>
