Difference between revisions of "LUA:SetTempVariable"

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

Latest revision as of 13:33, 25 May 2013

LUA Functions: SetTempVariable()

Sets a temporary variable for the given spawn


Syntax

SetTempVariable(param1, param2, param3)


Parameters

Required - param1 (Spawn), param2 (String), param3 (String, Spawn, Zone, Item, or Quest)
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 "nil"