I have a script that seems straight forward, check a token, if its not a player, and it has HP, set a red aura.
Problem its having is even with no HP set, it still sets the aura, and logging it returns exactly what the IF checks, and does it anyway.
"eBar1check NaN"
"eBar2check NaN"
anyone see why its passing the IF statement if Ebar == NaN?
Problem its having is even with no HP set, it still sets the aura, and logging it returns exactly what the IF checks, and does it anyway.
on("change:token", function (obj) { var oC = getObj('character', obj.get("_represents")); if(oC != undefined) return; var eBar = parseInt(obj.get("bar3_value")); log('eBar1check '+eBar); if(eBar != NaN) { log('eBar2check '+eBar); obj.set({'aura1_radius': -0.3,'aura1_color': '#ff0000','aura1_square': false}); } });When I log it, Ebar = NaN, and even the 'if' parts passes with it equalling NaN, and I get:
"eBar1check NaN"
"eBar2check NaN"
anyone see why its passing the IF statement if Ebar == NaN?