Scripts

getloadedmodules

Returns a new array table containing live entries from loaded module list.

Syntax

getloadedmodules(excludeCore?: boolean): table

Arguments

NameTypeDescription
excludeCore?booleanOptional boolean. Omitted or nil uses true. When true, entries under core packages or CoreGui are excluded. Non-boolean values are rejected by luaL_checkboolean.

Returns

NameTypeDescription
modulestableNew array table of pushed live entries from loaded module list.

Description

Returns a new array table containing live entries from loaded module list. The optional excludeCore argument is read with optional boolean handling and defaults to true when omitted or nil. If excludeCore is true, entries whose instance is a descendant of core packages or CoreGui are skipped. Expired weak entries and locked stored references without a value are skipped. The function pushes each remaining entry with Instance cache at sequential array indexes starting at 1. The function does not check ClassName, does not sort the result, and does not walk the DataModel.

Call it with 1 parameter(s): excludeCore. The argument table explains which values are required and which ones only refine the behavior.

It returns modules (table). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = getloadedmodules(true)
print(result)