aRotondi said: Doron B. said: the question is not how to fix this but rather why does it act like this? it works for me to on most of the tokens but it has unexpected behavior. returning true for an if statement that is clearly wrong on the very basic level of math.... i don't know what to tell you guys. it renders the API practically useless. This may be due to javascript not using 'defined' data types, so instead of doing something like the following: int v = 5; which clearly states that v is a number, javascript does this: var v = 5; which says to the compiler (thing that checks if you're script is valid) 'hey, see what types this can fit into'. This may be causing the compiler to see it as something other than a number (it happens, but its rare), which is why you will want to use Brandon's fix if you continue to have the issue. If it's still doing weird things after that, check to make sure v isn't the name of a variable in another script, as I am not sure how roll20 strings together it's individual scripts into one codebase, and it could be causing some scope issues. also I am sorry if I ever offend or say things bluntly, just trying to quickly diagnose your issue :). Javascript is a dynamic untyped language. It will treat variables as whatever it feels appropriate at the time, and in fact some JS libraries have pages of code committed to type coercion: essentially, tricking the runtime to treat an object as one type over another. This can occasionally be a problem with operators that do more than one thing. Is a + b adding two numbers, or concatenating two strings? When JS compares two strings, it compares the numeric values of the characters, and '5' (value 53) is greater than '1' (value 49), and I suspect the extra characters of the longer string (the '0' in '10' ) are simply ignored, thus the incongruity. (Similarly, 'Zebra' < 'aardvark' ) When both operands can convert to a number, JS ought to convert them to a number for the conversion (it's part of the spec), but over the years I have learned not to trust "ought to" when it comes to dynamic types. If I need a variable to be a certain type and I haven't already ensured it is that type in some way, I'll coerce it myself.