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 a macro that will make sure a subtraction never returns a negative number.

So I am doing some macros for shadowrun, and I would like to know a function to make sure that if Armor-AP ( @{armor_total}+?{Armor Penetration} ) is less than zero than it's just zero, it doesn't go negative, you know?? can anyone help me with this?
1522969113
The Aaron
Pro
API Scripter
You can use the keep high one modifier something like: [[ {( @{armor_total}+?{Armor Penetration} ),0}kh1 ]]
Thank you!! I infact tried that one before but I forgot the [[ ]] so it didn't work. after seeing your answer I understood why it wasn't working. Thank you!!
1522970180
The Aaron
Pro
API Scripter
Great!  No worries.