compare
The compare command is used to directly compare two values.



"if(compare,first value, method of comparison, second value)"


Argument Function
first value The value that is being compared to the second value.
method of comparison The method in which the two values are being compared (>, <, =, >=, <=).
second value The value that is being compared to the first value.



And example of the compare command used in a script is as follows...




The following script checks if the object was interacted with and if the players health is less than or equal to 100, and if so it will spawn a healthkit.


if(compare,playervar(hp),<=,100)
if(interact)
{
then(createloot,16,16,healthkit)
then(destroy)
}