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

How to use Token-Mod to reduce maximum but not current hit points - REQUEST

I use the below to increase the current and max hit points for an effect such as AID. How can this be modified to reduce ONLY the max but leave the current alone? !token-mod {{    --set bar1|[[{ (0@{selected|bar1} + 0d0+?{How many hit points do you increase?|0} ),  (0@{selected|bar1|max}d1 + (999)) }kl1 ]]   --report     all|"{name} gained or lost  {bar1_value:abschange} hit points"     gm|"{name} has {bar1_value}/{bar1_max} hp"   --ids @{selected|token_id}  }}
1739833104
timmaugh
Forum Champion
API Scripter
I'm not at my PC at the moment, but you can explicitly refer to the max value without referring to the current. I think it's using bar1_max instead of bar1. It's in the TokenMod help, if you get a chance to look it up before I can.
  !token-mod --help   I looked at the chat prompts but am still missing something. If someone wouldn't mind updating my script to subtract from Max Hit Points only, I would greatly appreciate the help :) Below was used to increase both current and max (except for the prompt change): !token-mod {{    --set bar1|[[{ (0@{selected|bar1} + 0d0+?{How many hit points do you decrease from Max Hit Points?|0} ),  (0@{selected|bar1|max}d1 + (999)) }kl1 ]]   --report     all|"{name} lost  {bar1_value:abschange} hit points"     gm|"{name} has {bar1_value}/{bar1_max} hp"   --ids @{selected|token_id}  }}
1739891526

Edited 1739891601
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Barry! Try this: !token-mod {{    --set bar1_max|[[{ (0@{selected|bar1_max} + 0d0+?{How many hit points do you decrease from Max Hit Points?|0} ),  (0@{selected|bar1|max}d1 + (999)) }kl1 ]]   --report     all|"{name} lost  {bar1_max:abschange} hit points"     gm|"{name} has {bar1_value}/{bar1_max} hp"   --ids @{selected|token_id}  }}