User Tools

Site Tools


script_syntax

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
script_syntax [2017/10/13 11:16] justinscript_syntax [2017/10/13 11:22] justin
Line 21: Line 21:
  
 ====If/Then/Else/End (Conditional)==== ====If/Then/Else/End (Conditional)====
-The "if/then/else/end" syntax allow you to branch your logic according to the results of evaluating a condition. In the order listed, it consists of the keyword "if", a condition to check, the "then" keyword, any statements to execute if the condition is true, optionally the "else" keyword followed by any statements to execute if the condition is not true, and lastly the "end" keyword. See [[Conditional Expression]] for more information and a list of valid comparison operators that can be used in the condition.+The "if/then/else/end" syntax allow you to branch your logic according to the results of a condition being evaluated. In the order listed, it consists of the keyword "if", a condition to check, the "then" keyword, any statements to execute if the condition is true, optionally the "else" keyword followed by any statements to execute if the condition is not true, and lastly the "end" keyword. See [[Conditional Expression]] for more information and a list of valid comparison operators that can be used in the condition.
  
 **Examples:** **Examples:**
 <code lua> <code lua>
-if global.property["xyz"== true then +if global.property["gems_collected"> 5 then 
-   display_message("")+   display_message("You've collected more than 5 gems!")
 end end
 </code> </code>
script_syntax.txt · Last modified: 2023/11/06 14:13 by justin