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

Target token, roll to attack, and apply damage if hits

1625163998
Siveron
Pro
Marketplace Creator
I really like roll20 but I am playing in a game on Foundry. One of the things I really like on Foundry is that I can hold ALT and target a creature. When I attack that creature it automatically calculates whether or not it hits and it removes the HP for the damage roll. Is there something like that on roll20, maybe an API that can be enabled?
1625164398
GiGs
Pro
Sheet Author
API Scripter
There are ways to do that for Pro users, using API script solutions. How to do it depends on your system, and what attribute names are.
1625167770
Siveron
Pro
Marketplace Creator
I do have a pro subscription and access to the API scripts. Can you tell me what scripts I should use? I could not find anything there that does what I want so far. 
1625175915

Edited 1625176048
vÍnce
Pro
Sheet Author
Jesse M. said: I do have a pro subscription and access to the API scripts. Can you tell me what scripts I should use? I could not find anything there that does what I want so far.  Regular macros cannot make attribute changes. Macro commands are basically read-only in regards to sheet attributes. To change attributes from a macro you'll need to use an API script (pro subscription) like tokenmod ,  chatsetattr ,  groupCheck ,  applyDamage , or similar.
1625185144
David M.
Pro
API Scripter
Then once you get the hang of the scripts that Vince shared, you can start to string together some conditional logic with the Scriptcards api script and have that script farm out scripts like token-mod or chatsetattr.
Nick Olivio has a great and simple video on YouTube to do this with powercards. 
1625271028
Siveron
Pro
Marketplace Creator
Thanks for all the info everyone. I will take a look at this stuff.
<a href="https://youtu.be/FIBo_BMpSNo" rel="nofollow">https://youtu.be/FIBo_BMpSNo</a>
1626020381
Surok
Roll20 Production Team
I've been trying to find an universal api/macro that does this. Unfortunaly the Nick video method you have to build each attack individually.&nbsp;