I notice in the first post above and your reply, rawdamage is written in two different ways. If the script runs fine without that line, do you not call dam anywhere? No-one is going to be able to diagnose this issue without a lot more information, like what is the script for, what does it do? how are the dam and rawdamage variables used? show every part of the code where they are relevant.