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

Adjusting Attributes

Hi, I am a novice scripter. I have a injury table that when you Crit does one of four injuries: -1 AC; -1 Atk; -1 Dmg; -5ft Movement Is there a way to write an API script so that when you roll, the targeted characters coinciding attribute is automatically adjusted? If the answer is yes, how? This is the current macro being used: @{selected|token_name} just Critically Hit @{target|token_name} and caused an injury, [[1t[Injury]]] I am aware that Pro level is required for API scripting. (I am still learning how API scripting works) All help is appreciated Thanks
ChatSetAttr is what you're looking for... it's in the One Click library! <a href="https://app.roll20.net/forum/post/6578447/script-update-chatsetattr-1-dot-8-now-with-inline-command-support" rel="nofollow">https://app.roll20.net/forum/post/6578447/script-update-chatsetattr-1-dot-8-now-with-inline-command-support</a>
1629202755
timmaugh
Pro
API Scripter
If you're learning about scripting, it's probably worth differentiating that some people call *using* scripts scripting, while others call *writing* scripts scripting. As far as the former... for sure, using a script can seem dense. (A command line interface, really?) And if you are using ScriptCards or chaining metascript&nbsp; constructions to accomplish some task from the tabletop/chat side of things, doubly so. If that is what you are looking to understand and use in your game, then like Myke said, something like ChatSetAttr or maybe CombatMaster is your friend. However, if you are really looking to write your own script, if you want to initiate the attack, designate a target, determine modifiers, assess line of sight, roll to hit, order a pizza, roll damage, figure custom knockback, take the kids to school, roll damage, and apply crits...? Then&nbsp; you're probably in the realm of writing your own javascript. Which side are you looking for?