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

Is there a way to If/Then/Else ??

1646631149

Edited 1646661050
See, I want to put a condition in a roll.  Roll 3d10, if some dice result in 1, then the dice with maximum value will be discarded.  Example:      /roll 3d10  1, 3, 6  Thanks to this "1", I want to remove/discard/ignore "6" from the results. Keeping the "3".  Is there a way to do that? Some "if" command. Edit:  IF there's no "1" on rolls, then I keep with all dices. 
What happens if you don't roll a 1? Do you keep all three dice rolls, or just the highest? If you explain the full mechanic it might be possible, but I would guess that it's unlikely without a custom API script (Roll20 Pro subscription required).
1646643387
GiGs
Pro
Sheet Author
API Scripter
Roll20 dice rolls don't support conditional statements like if/then/else. it's sometime spossible to come up with an expression to fake it, but I don't think there'll be anyway to do it for your mechanic. But as Jarren says, having the full mechanic described may give enough information to get one. I think you're best bet is a rollable table built from all the probabilities calculated out, though that will only work if the number of dice is always the same.
Jarren said: What happens if you don't roll a 1? Do you keep all three dice rolls, or just the highest? If you explain the full mechanic it might be possible, but I would guess that it's unlikely without a custom API script (Roll20 Pro subscription required). IF there's no "1" on rolls, then I keep with all dices. I'm sorry, just added to the post.
By checking how many 1's you roll in advance you can do it this way /r [[3-[[1d10<1]] ]]d10r1dh$[[0]] + $[[0]]d1 I've assumed that when you roll a 1 the 1 is still kept and only the high value is dropped