Hey, Rich! Welcome to the wonderful world of js coding and R20 scripting! Input I think the first thing to understand is that the API can't trigger a "pop up" or ask for user input (unless it filters that through the chat input or button interaction). So any prompt for user input is actually a roll query input into the front end of the user input (what is entered into chat). If it is important to keep the value separate from the base number of dice, you can feed it into a different parameter of your script and then let your script modify the base d6 based on your input: !rico --3 --?{Enter bonus amount...|0} This would assume that your script would add 3 and the result of the query (after you sanitize it), and roll that number of d6 for the user. Another option would be to let them use inline rolls, and then you roll the extra dice and add them to the die pool... !rico --[[3d6]] --?{Enter bonus amount...|0} In that case, you have to extract the roll from the result in the message object into some form you can modify (like an array), then push() your bonus dice into the result, too. Output You can structure the output as you see fit... using html div objects and inline css. If you want to include a button to reroll, you would need to (1) structure the target of the button to be an api call, and (2) create that interface to your script to catch the reroll command. For (1), the idea is: [Button Label](!api --args) ...or, if you're outputting html... <a style="any css here" href="!api --args">Button Label</a> As for (2), you need to structure the api call to be something your script will catch, and keep the data in a place where the script can reach. You have some options for that... a) command line for the button (in the script call) b) in the state variable c) in a particular attribute on the character sheet Of those, (a) is the cleanest, IMO. !rico --reroll --1|2|3|4|6|6|6 I'm expecting your script to parse that second argument on "|" and produce an array of values, for every non-six, replace the entry in the array with another roll of d6 (in place). In the end, you have replaced the non-6s with a new value, and you can do whatever you need to with the array (total it, output criticals, etc.). If your initial build of the rolled values ALSO worked with an array, at this point you have rejoined the logical structure of your code so you can hand off the array to your formatting and output processes to show you the HTML output the same as for the initial roll. Also, using this sort of command line for your input can also let you trap whether this is a reroll (is the first argument "reroll"?), so that if you wanted to limit the players' ability to reroll to just one time, you wouldn't output the reroll button if you were ALREADY processing a reroll. Logic vs Language That's the logic that I would suggest, but then it comes to the actual language and building the script. What's your comfort, there? There are some pretty good discussions on this forum (and in the wiki/documentation) about best practices, etc., so post back if you need some pointing in the right direction.