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

dice roll script help - minimum dice roll of 10 and maximum output of 30

Hello all, When I use this macro to roll dice it rolls a minimum dice roll of 10 and will not produce an output of less than 1 or more than 30.  Cool.   [[ {{1d20,10+0d0, 1 + 0d0}kh1, 30 + 0d0}kl1 ]] However, I wish to add the token's "Sleight of Hand" bonus using @{selected|acrobatics_bonus} but cannot seem to find where to place this bonus within the above macro without causing something to break. Does anyone see a solution to this? Thank you and regards, Barry
1573314897
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
How about: [[ {{1d20+@{selected|acrobatics_bonus},10+0d0, 1 + 0d0}kh1, 30 + 0d0}kl1 ]] although, if you want their sleight of hand bonus, that should be: [[ {{1d20+@{selected|sleight_of_hand_bonus},10+0d0, 1 + 0d0}kh1, 30 + 0d0}kl1 ]]
1573315100
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If you wanted to add the bonus last (i.e., exceed 30 on a good roll), use this: [[ {{1d20,10+0d0, 1 + 0d0}kh1, [[30+@{selected|acrobatics_bonus}]] + 0d0}kl1 ]] or [[ {{1d20,10+0d0, 1 + 0d0}kh1, [[30+@{selected|sleight_of_hand_bonus}]] + 0d0}kl1 ]]
Thanks for the suggestion keithcurtis but neither of the above two suggestions work.  I need it to create a minimum dice roll of 10, add the acrobatics bonus, and not exceed 30.  Thanks
1573318004
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Missed the minimum of 10. Try this: [[ {{1d20,10+0d0, 1 + 0d0}kh1+@{selected|acrobatics_bonus}, 30 + 0d0}kl1 ]]
1573318147
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
BTW, why the 1+0d0 in the first keep expression? wouldn't  {1d20,10+0d0}kh1  work to constrain the roll to no lower than 10?
Thank you keithcurtis! That seems to do the job. As for the 1+0d0 question, I honestly don't know.  I am not a scripter, I just often piece together things that I see work.  LOL