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): anyParameters
| Parameter | Type | Description |
|---|---|---|
target | ModuleScript | any | Module 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))
endExample output
true tableThe 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.
