User Tools

Site Tools


lua:getval

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

lua:getval [2015/09/02 21:23]
vodur created
lua:getval [2015/09/02 21:38] (current)
vodur
Line 1: Line 1:
-See also setval+<font inherit/​inherit;;​inherit;;​inherit>​Syntax1:​ getval()</​font>​ 
 + 
 +<font inherit/​inherit;;​inherit;;​inherit>​Returns a table of all the values for the character or object. The keys are the setval names and the values are the setval values.</​font>​ 
 + 
 +Syntax2: getval("​arg1",​ arg2) 
 + 
 +The first argument is the string/name of the value. The second argument is the value of the string you're checking. 
 + 
 +Example: 
 + 
 +<code lua> 
 +if ch:​getval("​minotaur_kill"​) == 1 then 
 +    sendtochar( ch , "​You'​ve killed the minotaur!\n\r"​) 
 +end 
 +</​code>​ 
 + 
 +In this example, the mprog could be attached to just about anything, using any trigger. The result would be the player getting a message that they'​ve killed the minotaur, if the value of "​minotaur_kill"​ was equal to 1. 
 + 
 +See also [[:​lua:​setval|setval]]
  
lua/getval.txt · Last modified: 2015/09/02 21:38 by vodur