so can someone help me understand what i have done wrong? im trying to set the script to change a value when one of two values change, thought i was setting it up right but i guess not. i want it to change it the armor type changes and if the dex mod (dex_ac) changes. But it will only change when the armor changes. Any help would be welcome. <script type="text/worker"><!-- Armor Value -->
on('change:Armor change:dex_ac' function() {
getAttrs(['Armor','dex_ac','con_ac','int_ac','wis_ac'], function(values) {
const Armor = parseInt(values.Armor) || 00;
const dex = parseInt(values.dex_ac);
const con = parseInt(values.con_ac);
const wis = parseInt(values.wis_ac);
const ini = parseInt(values.int_ac);
let ac1 = 10;
if (Armor == 00) {ac1 = 10 + dex;}
else if (Armor == 01) {ac1 = 11 + dex;}
else if (Armor == 02) {ac1 = 12 + dex;}
else if (Armor == 03) {ac1 = 13 + dex;}
else if (Armor == 04) {ac1 = 14 + dex;}
else if (Armor == 05) {ac1 = 15 + dex;}
else if (Armor == 06) {ac1 = 16;}
else if (Armor == 07) {ac1 = 17;}
else if (Armor == 08) {ac1 = 18;}
else if (Armor == 09) {ac1 = 13 + ini;}
else if (Armor == 10) {ac1 = 10+ dex + con;}
else if (Armor == 11) {ac1 = 13 + wis;}
setAttrs({
ac1: ac1
});
});
});
</script>