So I got it to work some what. In class that the npc is joined to I have
PHP Code:
function onLayerChange(){
this.trigger("Update");
//this.chat = "test1";//this worked
//this.layer = params[2];//can only be changed in clientside
this.triggeraction(this.x+.5,this.y+.5,"LayerChange2","");//doesnt work
}
//#CLIENTSIDE
function onPlayerEnters()
this.layer=this.attr[2]
//doesnt work
function onLayerChange2(){
this.trigger("Update");
this.chat = "test2";
onPlayerEnters();
}
the layer only changes when I update level or reenter level. I tried triggering "Update" for the npc in my weapon script and some other thnigs but no luck