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

Making Custom ROLL Buttons

1492717545

Edited 1492719320
AquaAlex
Sheet Author
Translator
API Scripter
So I added the red and green small button for a penalty and a bonus roll the script works if i set type='roll', but not if I set type='roll-pen' or type='roll-ben'  I assume I miss something when I created my own buttons? IN HTML: <td > <button type='roll-ben' value='&{template:coc} {{name=STR Roll}} {{success=[[@{str}]]}} {{hard=[[floor(@{str}/2)]]}} {{extreme=[[floor(@{str}/5)]]}} {{roll1=[[([[((({?{Number of Dice|1}d10}kl1)-1)*10) + 1d10]])]]}}' name='roll_str_check' /> <button type='roll-pen' value='&{template:coc} {{name=STR Roll}} {{success=[[@{str}]]}} {{hard=[[floor(@{str}/2)]]}} {{extreme=[[floor(@{str}/5)]]}} {{roll1=([[((({?{Number of Dice|1}d10}kh1)-1)*10) + 1d10]])}}' name='roll_str_check' /> </td> IN CSS: /* Buttons */ button[type=roll-ben] { color: #49FF33; background-color: #49FF33; font-weight: bold; text-align:center; width: 10px; height: 10px; margin: 0.0; padding: 0.0em; border: 1px solid black; border-radius: 5px; } button[type=roll-pen] { color: #C70039; background-color: #C70039; font-weight: bold; text-align:center; width: 10px; height: 10px; margin: 0.0; padding: 0.0em; border: 1px solid black; border-radius: 5px; }
1492719276

Edited 1492719362
AquaAlex
Sheet Author
Translator
API Scripter
Ok I solved it HTML: <td > <button type='roll' class='sheet-benefit' value='&{template:coc} {{name=STR Roll}} {{success=[[@{str}]]}} {{hard=[[floor(@{str}/2)]]}} {{extreme=[[floor(@{str}/5)]]}} {{roll1=[[([[((({?{Number of Dice|1}d10}kl1)-1)*10) + 1d10]])]]}}' name='roll_str_check' /> <button type='roll' class='sheet-penalty' value='&{template:coc} {{name=STR Roll}} {{success=[[@{str}]]}} {{hard=[[floor(@{str}/2)]]}} {{extreme=[[floor(@{str}/5)]]}} {{roll1=([[((({?{Number of Dice|1}d10}kh1)-1)*10) + 1d10]])}}' name='roll_str_check' /> </td> CSS: /* Buttons */ button[type=roll].sheet-benefit { color: #49FF33; background-color: #49FF33; font-weight: bold; text-align:center; width: 10px; height: 10px; margin: 0.0; padding: 0.0em; border: 1px solid black; border-radius: 5px; } button[type=roll].sheet-penalty { color: #C70039; background-color: #C70039; font-weight: bold; text-align:center; width: 10px; height: 10px; margin: 0.0; padding: 0.0em; border: 1px solid black; border-radius: 5px; }