
Hi all, Have been putting together a sheet worker using a simple calculation to work out a total attribute value based on an inputted value and a modifier based on race. This works fine, but I need the final value to be forced to be between 3 and 18. Here is an example of my current code and what I would like it to do is if the value of "int" + the value of "calc_raceINT" results in a value higher than 18, the value of "totalINT" is set to 18. Race modifiers have both positive and negative and it will be rare to happen, but just wanted to cover this situation. // Update INT value based on race on("sheet:opened change:race change:int change:calc_raceINT", function () { getAttrs(["int","calc_raceINT"], function(values) { var get_INT = parseInt(values["int"])||0; var get_raceINT = parseInt(values["calc_raceINT"])||0; var totalINT = get_INT + get_raceINT; setAttrs({ finalINT: totalINT }); }); }); Any thoughts? Thanks in advance.