No categories assigned

LUA:GetVariableValue

Revision as of 19:33, 8 August 2016 by Patrikpatrik (talk | contribs) (Notes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA Functions: GetVariableValue()

Gets the value of the given variable


Syntax

var = GetVariableValue(param1)


Parameters

Required - param1 (string)
param1 is the name of the variable


Usage

function hailed(NPC, Spawn)
    Say(NPC, "Level cap is set to " .. GetVariableValue("level_cap"))
end

The NPC will respond with the level cap for the server

Notes

Returns a string

This gets the values for variables in the `variables` table.

Also, if you want to return values set by SetServerVariable(), make sure to include the 'lua_' prefix, slightly different from GetServerVariable().