global.get 3

Get the value of a stored global variable


Return value

Return TypeDescription
anyThe variable that was stored. Expected types: bool, float, int, string. If the variable was never set, returns nil.

Parameters

ParameterTypeDescription
1stringIdentifier to get the stored value

Examples

-- retrieve a stored global numeric value
local somenumber = global.get("some_stored_integer")

-- retrieve a stored global boolean value
local someboolean = global.get("some_stored_bool")

-- retrieve a stored global text value
local sometext = global.get("some_stored_text")

Back to Scripting API