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

Using Attributes to determine how many dice to roll?

September 05 (8 years ago)
I'm trying to use Attributes from a character sheet to roll a number of dice equal to the Attributes:
/roll @{max_hits}d100
However, this only outputs @{max_hits}.
How can I format the roll so I can roll the d100 a times equal to @{max_hits}?
September 05 (8 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Try it with inline roll syntax:
/r [[@{max_hits}]]d100
or
[[ [[@{max_hits}]]d100]]

Technically those two should be identical (just inline roll output versus normal roll command output), but sometimes it seems like inline rolls play funnily with other things.
September 05 (8 years ago)
Ah, so I needed to finalize the attribute before trying to roll. Got it.
Thanks
September 05 (8 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I would have thought your syntax would work, but glad those ideas worked. If max hits isn't just a number that would explain it.
September 05 (8 years ago)

Edited September 05 (8 years ago)
Lithl
Pro
Sheet Author
API Scripter

Scott C. said:

I would have thought your syntax would work, but glad those ideas worked. If max hits isn't just a number that would explain it.
Depending on the calculation, (@{max_hits})d100 would also work.