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 .
×

Roll X dice > sum them > according to the result of the sum, the chat box shows a message

Good morning, could somebody help me with that? For example: I want to roll 2d6, if the result is a 7 I want the chat box to say " 7 - BRILLIANT COACHING", if the sum is a 2 I want the chat box to say "2 - GET THE REF" Thank you
1659533213
GiGs
Pro
Sheet Author
API Scripter
Dice rolls cant produce text in roll20. You'll need to look at Rollable Tables - unfortunately if the dice have modifiers, you'd need a separate table for each modifier, since rollable tales cant handle modifiers. Look at the weighting of each number on the dice and create a table entry with that weight, and the text you want to appear in chat. For example a 2d6 roll has weights of 1-2-3-4-5-6-5-4-3-2-1 for the rolls of 2-3-4-5-6-7-8-9-10-11-12. So you could have one entry: weight: 6 item: 7 - BRILLIANT COACHING and for rolls of 2: weight: 1 item: 2 - GET THE REF
1659538069
Ziechael
Forum Champion
Sheet Author
API Scripter
If using a rollable table you'll want to make sure the entry doesn't start with the number otherwise it will disregard everything beyond that point. You can wrap the number in brackets to prevent that behaviour but it depends on whether or not you want to use that value in a calculation. (7) - Brilliant Coaching [2] - Get the Ref etc
1659539818
GiGs
Pro
Sheet Author
API Scripter
Oh yes, excellent point.