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

Roll a Die and Return Result from Table

This should be pretty obvious, but I can't recall where I saw it. How to I roll a die and return that die's value from a rollable table?
1712597999

Edited 1712598040
GiGs
Pro
Sheet Author
API Scripter
There's no way to do this without a mod script. The Recursive Tables script is probably a place to start.
1712606372

Edited 1712606394
timmaugh
Pro
API Scripter
You can do this with the metascript toolbox. In fact, with the pending release, you can do this in a second, even easier way. Option 1 (Currently Available) Assuming your table is named "AwesomeThings" and had a total probability weight (totaling all of the items in the table) of 34, you can use a combination of Muler and ZeroFrame constructions like this: get.table.AwesomeThings.[[1d34]].value/get Alternatively, if you want the picture from the return, you can include "?image" just before the closing  /get : get.table.AwesomeThings.[[1d34]].value?image/get Either of those would need to be in a script command, so if you just wanted to see the result, you could do: !The value is get.table.AwesomeThings.[[1d34]].value/get {&simple} If the result contains an inline roll, this method will expand the first level of the return since it will be a plain text return. Further expansions (recursively) can be managed by including more .value constructions attached to the table returns that contain inline rolls. Option 2 (Coming with 1-click merge this week or next) Fetch has gotten a new ability to return from the table a random return... using either a roll or a "1dW" construction: @(table.AwesomeThings.1dW) ...or... @(table.AwesomeThings.[[1d34]].value) And it can get the image with a ".img" component: @(table.AwesomeThings.1dW.img) ...or... @(table.AwesomeThings.[[1d34]].value.img) More info will be coming when the update gets submitted to the repo...