Hello again, sorry to be back so soon but I ran into another problem whilst coding things. I'm trying to make an NPC targetting system (weapon set up to interface with clientr values, which are updated by the targets when clicked), and it seems to have problems sending my [this.] variables over triggerserver. I was wondering if I'm doing something wrong or is there a workaround I'm not quite seeing? Thanks in advance!
As a sidenote, this is the NPC being clicked as a demonstration of principle. I set the values clearly, but when it's sent via triggerserver they all come out as NULL or 0 values for some reason.
Quote:
function onActionTarget(){
pl = findplayerbycommunityname(params[0]);
pl.clientr.target_name = params[1];
pl.clientr.target_health = params[2];
pl.clientr.target_healthmax = params[3];
pl.clientr.target_level = params[4];
pl.clientr.target_healthbar = params[2]@"/"@params[3];
pl.(@ "Public/Struggler/NPCTargeting").trigger("update");
}
//#CLIENTSIDE
function onCreated(){
setshape(1,32,44);
showcharacter();
this.bodyimg = "body2.png";
this.shieldimg = "no-shield.png";
this.headimg = "head5.png";
this.nick = "";
this.blevel = 1;
this.bname = "Badguy";
this.health = 10;
this.maxhealth = 10;
this.ap = 0;
}
function onMouseDown(mode){
if(mode == "left"){
triggeraction(this.x,this.y,"Target",player.commun ityname,this.bname,this.health,this.maxhealth,this .blevel);
}
}
|