Globals
API for global functions.
Functions
issandbox
Returns whether the given parameter is a sandbox.
issandbox(value: any): boolean
Parameters
Name | Type | Default Value | Description |
---|---|---|---|
value | any | Required | The value to check. |
Returns
Name | Type | Description |
---|---|---|
isSandbox | boolean | Whether the value is a sandbox. |
require
Requires a module.
Modules are luau scripts which are executed in a sandboxed environment.
Modules return a value which is cached and returned on subsequent calls.
Modules can also refer to their path using the SCRIPT_PATH
global.
File path resolution
- If the path begins with
/
, it will only search the root directory. - If the path begins with
./
, it will search the directory of the calling script. - If the path begins with
../
, it will search the parent directory of the calling script. - If the path has no prefix, it will search the directory of the calling script, and then the root directory.
- If the module has no file extension, it instead searches for a
index.luau
file.
require(path: string): any
Parameters
Name | Type | Default Value | Description |
---|---|---|---|
path | string | Required | The path to the module. |
Returns
Name | Type | Description |
---|---|---|
module | any | The return value of the executed file. |