So, it doesn't currently appear to do anything, not sure if I'm messing up something simple on the code. I have the following code that works correctly onChange, but I need a code to run to update all the values like the onchange, when an attribute is changed/updated. So I'm trying to make a function call that will be called to run within the onChange's of all the attributes. (also the onChange is on line 1238 on <a href="https://github.com/BuildAndDie/roll20-character-sheets/blob/master/Open%20Legend%20Basic%20by%20Great%20Moustache/Open%20Legend.html" rel="nofollow">https://github.com/BuildAndDie/roll20-character-sheets/blob/master/Open%20Legend%20Basic%20by%20Great%20Moustache/Open%20Legend.html</a> haven't put the function version in yet, but pasted below) // On Change for calculating rolls for Actions on("change:repeating_actions:action_attribute change:repeating_actions:dice_d20", function() { getAttrs(["repeating_actions_action_attribute", "repeating_actions_dice_d20", "agility_score", "agility_dice_modifier", "fortitude_score", "fortitude_dice_modifier", "might_score", "might_dice_modifier", "learning_score", "learning_dice_modifier", "logic_score", "logic_dice_modifier", "perception_score", "perception_dice_modifier", "will_score", "will_dice_modifier", "deception_score", "deception_dice_modifier", "persuasion_score", "persuasion_dice_modifier", "presence_score", "presence_dice_modifier", "alteration_score", "alteration_dice_modifier", "creation_score", "creation_dice_modifier", "energy_score", "energy_dice_modifier", "entropy_score", "entropy_dice_modifier", "influence_score", "influence_dice_modifier", "movement_score", "movement_dice_modifier", "prescience_score", "prescience_dice_modifier", "protection_score", "protection_dice_modifier"], function(values) { var score = 0; if(values.repeating_actions_action_attribute === "Agility") { score = values.agility_score*1 + values.agility_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Fortitude") { score = values.fortitude_score*1 + values.fortitude_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Might") { score = values.might_score*1 + values.might_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Learning") { score = values.learning_score*1 + values.learning_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Logic") { score = values.logic_score*1 + values.logic_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Perception") { score = values.perception_score*1 + values.perception_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Will") { score = values.will_score*1 + values.will_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Deception") { score = values.deception_score*1 + values.deception_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Persuasion") { score = values.persuasion_score*1 + values.persuasion_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Presence") { score = values.presence_score*1 + values.presence_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Alteration") { score = values.alteration_score*1 + values.alteration_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Creation") { score = values.creation_score*1 + values.creation_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Energy") { score = values.energy_score*1 + values.energy_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Entropy") { score = values.entropy_score*1 + values.entropy_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Influence") { score = values.influence_score*1 + values.influence_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Movement") { score = values.movement_score*1 + values.movement_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Prescience") { score = values.prescience_score*1 + values.prescience_dice_modifier*1; } else if(values.repeating_actions_action_attribute === "Protection") { score = values.protection_score*1 + values.protection_dice_modifier*1; } var number = calcAttributeDiceNumber(score); var type = calcAttributeDiceType(score); var roll = ""; if(score === 0) { roll = "[[?{Do you have Advantage or Disadvantage?|Neither,1d20!!|Advantage,2d20!!kh1|Disadvantage,2d20!!kl1}]]"; } else { roll = "[[" + values.repeating_actions_dice_d20 + " + [[" + number + "+?{# of Advantage/Disadvantage Dice|0}]]" + type + "k?{Do you have Advantage or Disadvantage?|Neither,h|Advantage,h|Disadvantage,l}" + number + "]]"; } setAttrs({ "repeating_actions_dice_roll": roll }); }); }); Attempt to make a function to go through all the repeating actions. function calcAllActionRolls () { getSectionIDs("repeating_actions", function(actionsArray) { var update = {}; _.each(actionsArray, function(currentID, i) { getAttrs(["repeating_actions_" + currentID + "_action_attribute", "repeating_actions_" + currentID + "_dice_d20", "agility_score", "agility_dice_modifier", "fortitude_score", "fortitude_dice_modifier", "might_score", "might_dice_modifier", "learning_score", "learning_dice_modifier", "logic_score", "logic_dice_modifier", "perception_score", "perception_dice_modifier", "will_score", "will_dice_modifier", "deception_score", "deception_dice_modifier", "persuasion_score", "persuasion_dice_modifier", "presence_score", "presence_dice_modifier", "alteration_score", "alteration_dice_modifier", "creation_score", "creation_dice_modifier", "energy_score", "energy_dice_modifier", "entropy_score", "entropy_dice_modifier", "influence_score", "influence_dice_modifier", "movement_score", "movement_dice_modifier", "prescience_score", "prescience_dice_modifier", "protection_score", "protection_dice_modifier"], function(v) { var score = 0; if(v["repeating_actions_" + currentID + "_action_attribute"] === "Agility") { score = values.agility_score*1 + values.agility_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Fortitude") { score = values.fortitude_score*1 + values.fortitude_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Might") { score = values.might_score*1 + values.might_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Learning") { score = values.learning_score*1 + values.learning_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Logic") { score = values.logic_score*1 + values.logic_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Perception") { score = values.perception_score*1 + values.perception_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Will") { score = values.will_score*1 + values.will_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Deception") { score = values.deception_score*1 + values.deception_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Persuasion") { score = values.persuasion_score*1 + values.persuasion_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Presence") { score = values.presence_score*1 + values.presence_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Alteration") { score = values.alteration_score*1 + values.alteration_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Creation") { score = values.creation_score*1 + values.creation_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Energy") { score = values.energy_score*1 + values.energy_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Entropy") { score = values.entropy_score*1 + values.entropy_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Influence") { score = values.influence_score*1 + values.influence_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Movement") { score = values.movement_score*1 + values.movement_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Prescience") { score = values.prescience_score*1 + values.prescience_dice_modifier*1; } else if(v["repeating_actions_" + currentID + "_action_attribute"] === "Protection") { score = values.protection_score*1 + values.protection_dice_modifier*1; } var number = calcAttributeDiceNumber(score); var type = calcAttributeDiceType(score); var roll = ""; if(score === 0) { roll = "[[?{Do you have Advantage or Disadvantage?|Neither,1d20!!|Advantage,2d20!!kh1|Disadvantage,2d20!!kl1}]]"; } else { roll = "[[" + v["repeating_actions_" + currentID + "_dice_d20"] + " + [[" + number + "+?{# of Advantage/Disadvantage Dice|0}]]" + type + "k?{Do you have Advantage or Disadvantage?|Neither,h|Advantage,h|Disadvantage,l}" + number + "]]"; } update["repeating_actions_" + currentID + "_dice_roll"] = roll; setAttrs(update); // setAttrs({ // "repeating_actions_" currentID + "_dice_roll": roll // }); }); }); }); };