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 .
×
May your rolls be chill this holiday season!
Create a free account

Dropdown list and dice roll

I am using the following code for a macro: ?{Options| Option 1, /roll 1d20|  Option 2, /roll 2d20|  Option 3, /roll 3d20 } I am trying to make a different dice roll depending on the option chosen by the player and the dice roll is not made, only the string "/roll 1d20" appears. What am I doing wrong?
1590248138
GiGs
Pro
Sheet Author
API Scripter
The space here: , /  should not be there. ?{Options| Option 1,/roll 1d20|  Option 2,/roll 2d20|  Option 3,/roll 3d20 } when doing a /roll, the / has to be the very first character on the line. But in the above macro, that space gets printed first.
1590265928

Edited 1590266037
Thank you! I thank you 1d100 times!! My intention was a little more complicated. I want to add a modifier to the dice roll that the user will introduce. And add the difficulty that the user will also introduce. ?{Options| Option 1,/roll 1d20+?{Modifier|0}>=?{Difficulty|14}|  Option 2,/roll 2d20+?{Modifier|0}>=?{Difficulty|14}|  Option 3,/roll 3d20+?{Modifier|0}>=?{Difficulty|14}|  } It doesn't work for me. Can you help me?
I solve it. I had to replace some characters with their HTML codes. My problem now is that when I save the macro those HTML codes disappear.
I have read an answer from you answering the same question. SOLVED! Thank you!
1590269937

Edited 1590270096
Andreas J.
Forum Champion
Sheet Author
Translator
Just gonna point out that you can write that without html replacement, by simplifying it quite a bit. Some time it's hard to see the trees for the forest. /roll ?{Options|1d20 ,1| 2d20,2| 3d20,3| } d20+?{Modifier|0}>=?{Difficulty|14} This macro also better describe what the three options are.
1590298182

Edited 1590298231
GiGs
Pro
Sheet Author
API Scripter
pplurueda said: I have read an answer from you answering the same question. SOLVED! Thank you! I apparently give great help when I'm sleeping! I'm happy you got it sorted :) That's a great rewrite Andreas. Always better to avoid nesting when you can.