Skip to main content

Globals

API for global functions.

Functions

issandbox

Returns whether the given parameter is a sandbox.

issandbox(value: any): boolean

Parameters

NameTypeDefault ValueDescription
valueanyRequiredThe value to check.

Returns

NameTypeDescription
isSandboxbooleanWhether 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

NameTypeDefault ValueDescription
pathstringRequiredThe path to the module.

Returns

NameTypeDescription
moduleanyThe return value of the executed file.