Ok. I copied and pasted it exactly and am still getting the same error. Does the [0] default the value to 0 if no value is returned? Is that what that does? Either way I'm still getting the same error. Here is the whole of my code. It runs as intended if I comment everything in between my TEST_TEST_TEST area. However, when I uncomment the 2 var lines I get the error. on('chat:message', function(msg) { if(msg.type != 'api') return; var parts = msg.content.toLowerCase().split(' '); var command = parts.shift().substring(1); var selected = msg.selected; if(command != 'b' || !selected) return; // use the !b command, and have one or more things selected var damage = +parts[0]; if(!damage) damage = 0; // if no damage is returned, treat as 0 //TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST var oCharacter = getObj("character", obj.get("represents")); var oHealth = findObjs({name: "Bashing",_type: "attribute",_characterid: Character.id}, {caseInsensitive: true})[0]; //if (oBashing.current !== "") {oBashing.current == damage}; //sendChat(msg.who, "" + oCharacter) //sendChat(msg.who, "" + oHealth) //sendChat(msg.who, "" + damage); //TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST_TEST _.each(selected, function(obj) { if(obj._type != 'graphic') return; // only damage graphics var tok = getObj('graphic', obj._id); if(tok.get('subtype') != 'token') return; // don't try to damage cards tok.set('status_fist', false); var dmgicon = ''; while(damage > 0) { // get current digit, starting from ones var digit = damage / 10; digit -= Math.floor(digit); digit = Math.round(digit * 10); // shift damage damage = Math.floor(damage / 10); dmgicon += 'fist@'+digit+','; } if(dmgicon.length > 0) dmgicon = dmgicon.substring(0, dmgicon.length - 1); // trim trailing comma var markers = tok.get('statusmarkers'); if(markers != '') markers += ','; markers += dmgicon; tok.set('statusmarkers', markers); }); });