You are viewing an old version of this page. Return to the latest version.
Version of 18:56, 24 May 2013 by I need to Update My Profile
Difference between revisions of "LUA:GetTempVariable"
(Created page with "= LUA Functions: GetTempVariable() = Gets the value the given spawn has for the given variable ==== Syntax ==== var = GetTempVariable(param1, param2) ==== Parameters ==== ; R...") |
|||
| Line 14: | Line 14: | ||
==== Returns ==== | ==== Returns ==== | ||
| − | ; String | + | ; String, Spawn, Zone, Item, or Quest |
: Value for the given variable | : Value for the given variable | ||
| Line 28: | Line 28: | ||
==== Notes ==== | ==== Notes ==== | ||
| − | If the variable is not set it will return | + | If the variable is not set it will return nil |
| + | It is important that the scripter knows the type of the value stored in the variable | ||
Revision as of 13:32, 25 May 2013
Contents
LUA Functions: GetTempVariable()
Gets the value the given spawn has for the given variable
Syntax
var = GetTempVariable(param1, param2)
Parameters
- Required - param1 (Spawn), param2 (String)
- param1 is the spawn who's temp variable we are checking
- param2 is the variable we are checking
Returns
- String, Spawn, Zone, Item, or Quest
- Value for the given variable
Usage
function hailed(NPC, Spawn)
Say(NPC, "FOO = " .. GetTempVariable(NPC, "FOO") .. "!")
end
When hailed the spawn will say the value it has for the variable FOO
Notes
If the variable is not set it will return nil It is important that the scripter knows the type of the value stored in the variable