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 .
×
Create a free account

total rolled max 30, total rolled min 1, is this possible?

Hello script gods, Is there a command or way already developed for a total roll including modifiers such as + str bonus to never go above 30 or under 1? To be clear, a macro such as [[1d20 + @{Selected|Ability-Mod} + @{Selected|PB} ]] never giving a result above 30 or below 1.   Not a super high need, but against hugely powerful foes, or ones with crazy negitives, it would be great to see the rolls confined to the max and min of the allowed rolled totals of the 5e game.  Thanks! Barry
1472923960

Edited 1472924121
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Could do on or the other with kh/kl. [[{1d20 + @{Selected|Ability-Mod} + @{Selected|PB},30d1}kl]] Or [[{1d20 + @{Selected|Ability-Mod} + @{Selected|PB},1d1}kh]] Could maybe combine them as: [[{{1d20 + @{Selected|Ability-Mod} + @{Selected|PB},30d1}kl,1d1}kh]] I'm on my phone, so I can't test it. EDIT: may need to add some nested inline rolls in there
Thank you for the suggestion Scott C.  I do get a "SyntaxError: Expected [0-9] but end of input found" for each of the script suggestions though.
Try this: [[ {{1d20 + @{Selected|Ability-Mod} + @{Selected|PB}, 1 + 0d0}kh1, 30 + 0d0}kl1 ]]
Thank you Silvyre! Works perfectly. =D