Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

checkbox input add to roll help

I'm trying to make a custom character sheet, and struggling with having a checkbox which, when checked, will add an inputted value to a roll. Say I write "13" into an input, select the check, and when I roll it adds 13 to the roll. I've seen some other sheets do that and have been struggling to find the code for it.
1615699695
vÍnce
Pro
Sheet Author
Given that your @{your_checkbox} is set as "0" for unchecked or "1" if checked, just multiply your @{your_modifier} by @{your_checkbox_attribute}. ie @{your_checkbox}*@{your_modifier} and include this in the button's value/macro. simple example; Modifier:<input type="number" name="attr_your_modifier" value="0" /> Apply Mod?:<input type="checkbox" name="attr_your_checkbox" value="1" /> <button type="roll" name="roll_attack" value="&{template:default}{{name=Attack Roll}}{{Attack=[[1d20 + [[@{your_checkbox}*@{your_modifier}]]  ]]}}">Roll</button>
thank you that worked great!