If Score Icon If Score

This action is used to check the value of the instance variable score using a specific expression. You give the type of expression to check with and the value to check the current score against, and the "if" statement will always return either true or false depending on the expressions and values used. The available expressions are:

If you flag the Not argument, then the above will be negated expressions, for example "equals to" becomes "not equals to", so you would be checking if the score value is not equals to the given value.

IMPORTANT Due to floating point precision issues, checking to see if two values are exactly equal may return false, since one may be exactly 1, while the other may be 1.00000000000001. This can be avoided by using the Decimal To Integer action before checking or using the "greater than" or "less than" expressions.

Note that to add actions into the "if" block, they should be dropped to the side of the action, as shown in the image below:

If Score drop actionsThese actions will now be run if the "if" evaluates to true, while any actions dropped elsewhere will be performed after the "if" block.

 

Action Syntax:

If Score Action

Arguments:

ArgumentDescription
NotSet to check if the expression does not evaluate to true.
ExpressionThe type of expression to use for the check.
ValueThe value to check the score against.

 

Example:

If Score ExampleThe above action block code will add 1 onto the score value and then check it to see if it is equal to 1000. If it is then 1 is added on to the global scope variable "Level".