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

Need help on basic targeted attack macro vs AC

I'm new to macros and have been playing around with them for a couple of days now.  I can't figure out or find the macro I want, but it seems like a simple enough design.  Can anyone help? I'm looking for a generic attack roll (d20) vs a target's AC, that will 1) announce the attack against the target, 2) roll the die and, 3) compare the die result vs the AC (bar2) and declare whether it's a hit or not.  I have the basic roll (/roll d20) but can't figure out how to have the macro compare the outcome of the roll vs the target's AC (bar2) and then declare a hit.  Nor can I figure out how to say "rolling to attack @target"  with an actual target name showing up in the outcome rather than "@target". Any pointers?  Thank you.
1621795398

Edited 1621796789
vÍnce
Pro
Sheet Author
If you want to use the default template, not sure you can get inline rolls to declare if it's a success or not.  This is often done using custom roll template code tied to a particular sheet.  Something like this should work.  (I added a damage roll w/query, but you could remove it/modify as needed, obviously you just ignore damage if the attack roll was now successful...) &{template:default} {{name=@{selected|character_name} is rolling to attack @{target|token_name}}}[[ [[1d20]]+[[?{Attack mod?|0}]] ]]{{Attack Roll:=$[[2] ] vs AC @{target|bar2}}} {{Damage Roll:=[[?{# of dice|1}d?{sides|4}+?{Damage mod?|0}]]}}