Hello all, So, I'm struggling to get something basic working. I'm using a custom system. The jist of the system is that different attribute values role different dice whish should average the attribute value. Example small example: 7=3d3+1 8=3d4+1 9=4d3+1 10=4d4 So, as the attribute changes. the roll changes. I'm trying ta have a button <div> <input type="hidden" name="attr_sd" vaule="1d3-1"/> <input type="number" name="attr_strength" min="1" value="9" max="29"/> <button type="roll" name="roll_strengthcheck" value="/r @{sd}"></button> </div> I have a the following script which should look up the new dice string for the roll value and store it in sd. const parseValues = (values, stat, type='int') => { if(type === 'int') return parseInt(values[stat])||0; else if(type === 'float') return parseFloat(values[stat])||0; else if(type === 'str') return values[stat]; else return 0; }; const attributeDiceToRoll =(value) => { console.log("attribute value "+value); switch(value) { case 7: return "3d3+1"; break; case 8: return "3d4+1"; break; case 9: return "4d3+1"; break; case 10: return "4d4"; break; } }; on("change:strength sheet:opened", function() { let strength getAttrs( [ "strength" ], function(values) { strength = parseValues(values, "strength"); console.log("Strength "+strength); let sdice = attributeDiceToRoll(strength); console.log("sdice "+sdice); setAttrs({ "sd":sdice }); //setAttrs }); // getAttrs }); // onChange ---------- Clicking the roll_strengthcheck button shows in the chat: There was an error with your formula. Please try again. While, the console is showing a SyntaxErr expected: Array(13), found: null, message: "Expected "(", ".", "[", "abs(", "ceil(", "d", "flo…, [ |\t], [+|\-] or [0-9] but end of input found.", offset: 0, …} Any tricks to figuring out where this is coming from would be appreciated. Thank you for reading.