Unlike a field that stores a value (the field[abValue].value part), a variable can't persist from script to script, so you can't have script #2 calculate the right value for the variable, and then script #3 try to make use of it (oh, and script #3 isn't currently trying to make use of it - it's still referencing field[abValue].value, where it should be using hitpointstoadd.
You'll have to put both of those pieces of code into the same script for this to work in a template, where you don't have access to the value fields like abValue.
|