getmodules
Gets all ModuleScripts in the game.
Syntax
getmodules() -> tableReturns
| Type | Description |
|---|---|
table | Array of all ModuleScripts |
Description
getmodules returns an array of all ModuleScripts in the game, including those that haven't been required yet.
Example
local modules = getmodules()
print("Total modules:", #modules)
-- Find a specific module
for _, module in ipairs(modules) do
if module.Name == "Settings" then
print("Found Settings module at:", module:GetFullName())
end
endNotes
- Returns all ModuleScripts, not just loaded ones
- Use
getloadedmodulesfor only required modules
Related Functions
getloadedmodules- Get loaded modules onlygetscripts- Get all scripts