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

!token-mod script help request

Hello Everyone, Does anyone see what scripting error I have made here? It prints the correct calculation in the chat window, but does not increase bar1 by that amount for some reason... !token-mod {{ --set bar1_value|[[{ (0@{target|Target|bar1} + 0d0 + ?{Psionic point investment|0}), 0@{target|Target|bar1|max}d1 }kl1 ]] --ids @{target|Target|token_id} } *As a reaction to using PSYCHIC POWER,* ***@{selected|token_name} heals a small amount from his wounds!*** /w GM He can use this as a BONUS ACTION ``only`` immediately after using a psychic ability, and then only for the amount of psi that he used! In this case, he used [[ 0d0 + ?{Psionic point investment|0} ]] points of Psi! %{selected|Portrait} Thanks for any insight someone may be able to offer! Barry
1496082867
The Aaron
Pro
API Scripter
Hmm. Try taking the ! off the front and see if it prints the command you expect to the chat. Try replacing the calculation with a number and see if it makes the change you expect. I'm kind of restricted on my access this week as I'm out of town. Let me know if that helps you sort it out. If not, I'll try to test this out the next time I have internet access for my laptop. 
Thanks Aaron, Taking the ! off of the front changed nothing.  It still prints that 7 points were used (the number I input) but does not increase bar1 by 7... Barry
1496130374

Edited 1496130683
Ziechael
Forum Champion
Sheet Author
API Scripter
Try removing the bolded 0's (also, missing a } at the end): !token-mod {{ --set bar1_value|[[{ ( 0 @{target|Target|bar1} + 0d0 + ?{Psionic point investment|0}), 0 @{target|Target|bar1|max}d1 }kl1 ]] --ids @{target|Target|token_id} } } You could also simplify a bit by removing the 0d0 and using the bar1 value as a 'roll': !token-mod {{ --set bar1_value|[[{ (@{target|Target|bar1} d1 + ?{Psionic point investment|0}),@{target|Target|bar1|max}d1 }kl1 ]] --ids @{target|Target|token_id} }}
1496152610
The Aaron
Pro
API Scripter
Barry S. said: Thanks Aaron, Taking the ! off of the front changed nothing.  It still prints that 7 points were used (the number I input) but does not increase bar1 by 7... Barry Do you mean that with the ! It is still just printing out the command rather than running it?