
Hello, I wrote a simple script for a character sheet, and the first half works but not the second: on("change:pv", function() { getAttrs(["pv", "pv_max"], function(values) { let mod = "[[("; let ago = Math.round((values.pv_max / 8)); if (values.pv > ago) mod = "[[("; else if (values.pv == ago) mod = "à l'agonie [[(-1+"; else if (values.pv < ago) mod = "à l'agonie [[(-1+"; else if (values.pv == 0) mod = "au bord de la mort [[(-2+"; else if (values.pv < 0) mod = "au bord de la mort [[(-2+"; setAttrs({ agomod: mod }); }); }); It seems obvious to me now that the problem is that the script ignores the last two else ifs because the second one (values.pv < ago) already covers their 'range' of values. So provided values.pv is not greater than ago, this script always returns "à l'agonie [[(-1+", even when the hitpoints (pv) are null or negative when it should return " [...] [[(-2+". Is there a way to set a range of values to be compared to ? like [ 1->ago ] ? Or are there any other way to make my concept work? Thank you, from a script newbie.