global.set 3

Set a global variable that can be referenced from any script and by any player in the room


Return value

Return TypeDescription
voidThis function doesn't return anything

Parameters

ParameterTypeDescription
1anyA variable to store. Accepted types: bool, float, int, string
2stringIdentifier to get the stored value

Examples

-- save a value "100" on a global variable
global.set(100, "some_stored_integer")

-- save a value "true" on a global variable
global.set(true, "some_stored_bool")

-- save a value "hello!" on a global variable
global.set("hello!", "some_stored_text")

Back to Scripting API