No categories assigned

LUA:SetTempVariable

Revision as of 19:00, 24 May 2013 by Jabantiz (talk | contribs) (Created page with "= LUA Functions: SetTempVariable() = Sets a temporary variable for the given spawn ==== Syntax ==== SetTempVariable(param1, param2, param3) ==== Parameters ==== ; Required - ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA Functions: SetTempVariable()

Sets a temporary variable for the given spawn


Syntax

SetTempVariable(param1, param2, param3)


Parameters

Required - param1 (Spawn), param2 (String), param3 (String)
param1 is the spawn we want to set a temp variable for
param2 is the variable we want to set
param3 is the value of the variable


Usage

function hailed(NPC, Spawn)
    Say(NPC, "Setting FOO to BAR")
    SetTempVariable(NPC, "FOO", "BAR")
end

When hailed the spawn will set the variable FOO to have a value of BAR

Notes

This can be used on players as well as NPC's The values will not persist through zoning, camping, or zone shut down To clear a variable you can set it to ""