Kurt J. said: Richter Scales said: I think I need a bit of help with a block of code. It's using the built-in object modification functions of ScriptCards. The goal is to update the bar1 value of a token after it's been attacked, to show the damage it took. However, when I run the script, the bar1_value is never updated, and if I try to display the value of bar1 in an output window, it comes back as undefined. I've tried just about everything I can think of; the token is linked to the character sheet, bar1 is linked to HP, it's all there, as far as I can tell. I copied the syntax for the token command from the 5e magic missile script example, so the syntax should be correct. --/| Apply the damage to the token --!t:[%2%]|bar1_value:-=[$attackDmg] --+hp|[*[%2%]:bar1_value] --?[*[%2%]:bar1_value] -gt 0 -or "[*[%2%]:auras]" -inc "Stand"|survived --"[*[%1%]:auras]" -ninc "Massive" -or [$attackDmg] -lt [*[%2%]:bar1_max] * 0.8|survived --!t:[%2%]|bar1_value:0 -->EndBattle|[%1%];[%2%] --:survived| In the above code block, the output line shows "undefined" as it is, but if I change it to t-name instead of bar1_value, then it shows the token's name just fine. So a couple of things: When using [*x:xxx] referencing, token properties must be prefixed with t- (otherwise it will look for a character attribute by that name), so "--+hp|[*[%2%]:bar1_value]" should be "--+hp|[*[%2%]:t-bar1_value]". If you don't use the prefix, you will get "undefined" as indicated above. This "--"[*[%1%]:auras]" -ninc "Massive" -or [$attackDmg] -lt [*[%2%]:bar1_max] * 0.8 |survived" will not work for at least two reasons: First, it is missing the ? at the beginning (--" is not a valid statement type so is currently being ignored). Even if you add the ?, however, you will get an error in the console log stating that the condition "contains an invalid clause joiner". This is because your can't inline math operations (the *0.8) inside a condititional statement. You would need to have a --= like to calculate the massive damage threshold beforehand and compate to that variable. Since you are using [%1%] and [%2%] parameters, I assume you are calling this code as a subroutine. It would be valuable to see the statement that calls this code to see what is getting passed into parameters 1 and 2. Thanks for the advice about the ? conditional issues. I made those changes, and I can read the value of the bar now that I used t-bar1_value. However, I still can't seem to update the token's bar value with the --! command. I was curious about if I could do a roundabout solution and update the linked character sheet's HP value instead, to update the token bar that way. Sadly that didn't work either. I've included the full macro that I'm using here and the custom character sheet HTML here . As a developer myself, I'm trying to troubleshoot as much on my own as possible, so that you don't have to be bothered with my stupid issues. Right now the main thing I am looking to figure out is why I can't update the token values/character sheet values. I'm sorry to put this on you. Thank you for helping me! EDIT: I have been doing some testing on my own and I'm quite baffled. I just copied the examples from the wiki page and put them in a little 3 line script, and it doesn't update the token values. !script {{ --+|@{selected|token_id} --!t:@{selected|token_id}|bar1_value:+=1 --!t:@{selected|token_id}|t-bar1_max:+=3 }} Is there a script or game setting that I'm missing? I have made the tokens completely visible to and editable by all players. Second Edit: I was able to get what I needed with a workaround. I called tokenMod and chatSetAttr to set the properties I needed, and just used some additional logic in the script.