> ## 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.

# getdeletedmodules

```luau theme={null}
getdeletedmodules(): {ModuleScript}
```

Returns a list of all ModuleScript instances that were deleted or removed from the game hierarchy but still reside in memory.

## Returns

`{ModuleScript}` - An array of deleted ModuleScript instances.

## Example

<CodeGroup>
  ```luau Example 1 theme={null}
  -- Print all deleted module scripts still in memory
  for _, module in ipairs(getdeletedmodules()) do
      print(module.Name)
  end
  ```

  ```luau Example 2 theme={null}
  -- Track module script cleanups
  local count = #getdeletedmodules()
  print(`Deleted ModuleScripts in cache: {count}`)
  ```
</CodeGroup>

<Tip>
  Anti-cheat systems may check if deleted scripts are still running. Use this function to identify orphaned ModuleScripts.
</Tip>
