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

[Help] API for Critical Strikes!

Hi hi you guys, the question is simple, but since I'm not very good at Javascript I'm going to put this in C++ terms, maybe someone can help me Is something like this Int CriticalStrike(int Damage) { int x x = d100 if(x>76){ Damage = Damage * 2 } return (Damage) } So, the questions are the following. first) How do I call the attribute "Damage", or in general, how do I call an attribute from my character page. Keep in mind I'm not using character sheets, just Attributes & Abilities. second) Would it work, if converted to javascript?
1586076709
GiGs
Pro
Sheet Author
API Scripter
It would need to be converted to javascript to use it, but it wont work on its own. You need to define how you plan on using it.  Chances are you need to create a script to replace the normal roll functionality of roll20, and that can be a big job, especially since it will have to be used for all rolls. The Customizable Roll Listener script can listen to rolls and send things to chat, so you could (I think, I havent used it) have it detect a critical and tell you to double damage. The PowerCards API might also do what you want - it replaces your normal rolls, but you can do a lot mor with your rolls. You might be able to double damage on criticals.
Thanks for the info good man!