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

How to use selected with Macros

Hey guys I am trying to figure out a way to set up a Macro to use with any creatures attack.&nbsp; &nbsp;This would include the attack roll adding or subtracting any modifier to it.&nbsp; Along with having a note for special attacks and the save for the attack. I found a Macro that is exactly what I was looking for,&nbsp; <a href="https://roll20.zendesk.com/hc/en-us/articles/360037257334-How-to-Make-Roll-Templates" rel="nofollow">https://roll20.zendesk.com/hc/en-us/articles/360037257334-How-to-Make-Roll-Templates</a> ,&nbsp; &amp;{template:default} {{name=Test Attack}} {{attack=[[1d20]]}} {{note= This is some note content}} {{Saving Throw= vs Will}} Trying to accomplish my goal I added an attribute THAC0 to every monster.&nbsp; This way I can simply selected the creature hit the button and it spits out the attack roll + THAC0 bonus to hit.&nbsp; Along with any notes on the attack and saves required. This works perfectly when I have a creature in the formula &amp;{template:default} {{name=Test Attack}}{{attack=[[1d20+@{kobold |THAC0}-20&nbsp; }]] }}{{note= Try again and put notes in here}} {{Saving Throw= vs will}} However when I replace kobold with selected I get this &amp;{template:default} {{name=Test Attack}} {{attack=[[1d20+@{selected|THAC0}-200&nbsp; ]]}}{{note= Try again and put notes in here}} {{Saving Throw= vs Will}} Any help would be greatly be appreciated. Sorry if this seemed random but its my first time posting on roll20.
So I have solved this issue and I feel like an idiot.&nbsp; I missed a } right after 20 and now its working just as I want. &amp;{template:default} {{name=Test Attack}}{{attack=[[1d20+@{selected|THAC0}-20&nbsp; ]]}}{{note= Try again and put notes in here}} {{Saving Throw= vs Will}} &amp;{template:default} {{name=Test Attack}}{{attack=[[1d20+@{selected|THAC0}-20&nbsp; }]] }}{{note= Try again and put notes in here}} {{Saving Throw= vs will}}
1581967585
GiGs
Pro
Sheet Author
API Scripter
Congrats. We've all felt like an idiot a few times when making macros or roll20 code. :)