AcediaDocumentation

require

Loads a module through Acedia's module handling or the engine require path.

Module loading can run module code and produce side effects. Other input forms retain engine restrictions.

require(target: ModuleScript | any): any

Parameters

ParameterTypeDescription
targetModuleScript | anyModule target; non-ModuleScript inputs use the engine path.

Example

local target = game:FindFirstChildWhichIsA("ModuleScript", true)
if target then
    local ok, result = pcall(require, target)
    print(ok, type(result))
end

Example output

true	table

The second column reports the type of the module's return value; most ModuleScripts return a table.

Errors: Invalid module targets and compilation or module execution failures raise errors.

On this page