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 .
×

Simple Crit Script Help

1595383165
Mech
Pro
Sheet Author
I am using custom gamerules where you have a ceirtain number of points, called combo points (cp). There are many ways of gaining these points, and one of them is rolling a 20 on any roll. All I need is a script that assigns a point to the attribute called cp on the character that rolls a 20. All rolls are buttons on the character sheet, so inline commands might work, but I haven't found a way to do it. How can that be done?
1595385407
The Aaron
Roll20 Production Team
API Scripter
What character sheet are you using?
1595445341

Edited 1595446468
Mech
Pro
Sheet Author
I use a custom character sheet and cp are stored in a 'cp' atribute. I already modify the cp on a roll, using: !modbattr --name @{charactername} --cp|{{cp=CP changes by [[-1]]}}!!! I dont know if something like that can be applied on a crit, only adding 1 instead of reducing 1.
1595455815
Mech
Pro
Sheet Author
Right now I modified my roll template so it shows an ability roll when a crit is rolled,and the players have to click it for the cap to change. I would love if it could happen automatically. Seen here, a non crit roll, a crit roll and the crit ability rolled:
1595532010
The Aaron
Roll20 Production Team
API Scripter
I think you'd need a custom script to do this.  It would need to detect the a crit from the rolltemplate output, then adjust the attribute for the character the template was issued for.  There would need to be something in the template that links it back to the character.