You not really need to use testplayer.. just if you wanna something in special.. but to work with hearts, swordpower..etc.... you can use the map info, so there is no lag.. i.e.
NPC Code:
//#CLIENTSIDE
if(mousedown){
for(this.a=0;this.a<playerscount;this.a++){
if(mousex in |players[this.a].x-2,players[this.a].x+2| && mousey in |players[this.a].y-2,players[this.a].y+2|){
if(players[this.a].hearts>0){say2 A player;}else {say2 A npc;}
}
}
}