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

Specific range with a cap

I've been trying to make a macro which changes the range of a character's attack to match their level. The formula is 10ft + 5ft every 2 character levels, to a maximum of 30ft. I've tried looking at the wiki, but I still can't get it to work. The macro I currently have is  Range= [[ 10 + 5 * floor(0.5*(@{selected|Character_Level}/2)) ]] but I can't seem to get it to cap at 30, instead it keeps going to 60 and above, when I adjust the level of the character. 
1599066070
David M.
Pro
API Scripter
Try this. The inline roll will return the lowest number between (1) your formula and (2) 30. Range= [[ {10 + 5 * floor(0.5*(@{selected|Character_level}/2)), 30}kl1 ]]
David M. said: Try this. The inline roll will return the lowest number between (1) your formula and (2) 30. Range= [[ {10 + 5 * floor(0.5*(@{selected|Character_level}/2)), 30}kl1 ]] Worked perfectly, thank you!