$if
checks the expression and executes code inside it if true you can use $elseIf to check other conditions if previous one is false you can use $else to execute code block if nothing is true
Related functions
$endif
$else
$elseif
$elseendif
Usage: See below
Example 1 only with $if
Since the username of the executor is Tom it executed the if block
Example 2 only with $if and $else
Since the username is not Tom it executes the else block
Example 3 $if , $else and $elseif
Since the username is not Tom .It goes to the next if statement ,which is $elseif[$username==Lisa] and it will execute it
Example 4 $if , $else and $elseif
Since the username is not Tom .It goes to the next if statement ,which is $elseif[$username==Lisa] and it will execute it
Info: The second else if will get never executed ,because it will exit the statement after the first true expression
Example 5 multiplie condtions in if with && or ||
$if[] allows you to have multiplie condtions
||
is for OR
&&
is for AND
The Example below will execute since $username==Tom is false but the second expression is true .It wouldn't work with &&
The Example will only execute if the username is Lisa and their tag is 9999