Environment

getscriptglobals

Returns global values visible to scripts in the current context.

Syntax

getscriptglobals(): table

Returns

NameTypeDescription
globalstableGlobal values table.

Description

Returns global values visible to scripts in the current context.

Call it without parameters. The function reads the needed context from the current runtime state.

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

Example

Example call with placeholder values.

local result = getscriptglobals()
print(result)