# How can I make a Roll20 macro that shows different text depending on the result of a die roll?

I would like to roll for the random Chaos Bolt (first level spell) damage type, which is variable.

In play, I have to roll 1d8 and as a result I get the damage type of the spell:

I guess it should be something like:

&{template:default} {{name=Damage Type}}
{{[[1d8]]|acid|cold|fire|force|lightning|poison|psychic|thunder}}


The result should be:

• Damage Type: cold

Nice to Have:

• if you hover over cold you see '2'
• Note that Chaos Bolt has you roll *2*d8, and you can pick either one to determine the damage type. Jan 22, 2020 at 16:04
• @GreySage Thanks, I will add that to the macro Jan 22, 2020 at 19:31
• You shouldn't edit your question to include the answer (or rather, the macro you arrived at based on the answer). Instead, you should leave it as a comment on the accepted answer, or as an answer itself if you feel it is sufficiently distinct from the existing answer. In general, answer content doesn't belong in the question; it makes the post confusing to read and discourages future answers.
– V2Blast
Jan 23, 2020 at 8:16
• – V2Blast
Jan 23, 2020 at 8:18
• @Torsten: I'm aware. The previous comment that linked to it just mostly made a point that was already addressed (it linked the related question as an afterthought to that point), so I deleted that comment and reposted the link to the related question as its own comment. :)
– V2Blast
Jan 23, 2020 at 9:46

This is something you should use a Rollable Table for. Create a table with 8 entries, one for each damage type. You could call it "Chaos-Bolt". Then modify your macro above to:

&{template:default} {{name=Chaos bolt}}{{damage type = [[1t[Chaos-Bolt]]]}}


If you want the actual number to show, just write the entries as:

Acid (1)
Cold (2)
...


The results will look like this:

• Great to see you drop by again, thanks Keith! I have a shadow sorcerer in the game I DM who would like this. Jan 22, 2020 at 16:36
• Perfect solution. Thanks a lot. That one works great. Jan 22, 2020 at 17:25