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

Checking if a roll with a dificulty of an other roll

Hello everyone I am trying to make a macro that checks if an attack is a success vs the evasion of the enemy. I have been trying some diferent ways but cant find how to make it work, i's something like this &{template:default} {{name=@{selected|token_name} attacks @{target|token_name}}} [[[[1d20+@{selected|attack}]]>[[1d20+@{target|evasion}]]]] {{Result= $[[2]]}} I thought it would give a 1 if success or 0 if fails.. but seems not to work.  Can anyone help me?
1615043182

Edited 1615043376
Ziechael
Forum Champion
Sheet Author
API Scripter
You were close but your grouping of the rolls was breaking the comparison logic... try this one: &{template:default} {{name=@{selected|token_name} attacks @{target|token_name}}} [[{1d20+@{selected|attack}}>[[1d20+@{target|evasion}]]]] {{Result= $[[1]]}} You could combine it with this stupid trick to get custom output messages too ;) &{template:default} {{name=@{selected|token_name} attacks @{target|token_name}}} [[ 1t[ [[{1d20+@{selected|attack}}>[[1d20+@{target|evasion}]]]] ] ]] {{Result= $[[2]]}}
Thank you very much.. i will try it asap!!