Skip to content
This repository was archived by the owner on Jul 30, 2023. It is now read-only.

'GetGlobal' function (EN)

Archie edited this page May 23, 2021 · 1 revision

GetGlobal function

Returns a game global

Syntax

<RValue> GetGlobal(
    <string> GlobalName
);

Parameters

ObjectName

Type: String

The name of the global. Examples: gold, lv.

Return Value

Type: RValue

A copy of the global.

To apply your changed copy into the game, see the SetGlobal function.

Example

local rvGold = GetGlobal("gold"); -- Get the global "gold" and store it in the "rvGold" variable
print(rvGold.realval); -- Print the real value onto the screen.

Clone this wiki locally