Quote:
Originally Posted by cbk1994
You can't do point-triggers to clientside, though.
|
You can since V6, I have a lot of scripts which work as follows:
PHP Code:
function onUpdate(temp.val) {
this.attr[4] = int(timevar2);
this.attr[5] = temp.val;
triggeraction(this.x + 1, this.y + 1, "Update", "");
}
//#CLIENTSIDE
function onCreated()
this.setshape(1, 32, 32);
function onPlayerEnters()
if (this.updatetTime != this.attr[4])
this.onActionUpdate();
function onActionUpdate() {
this.updatetTime = this.attr[4];
echo("New value is " @ this.attr[5]);
}
Looking at -
Quote:
Originally Posted by Kirko
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 }
|
this.triggeraction() won't work as it is not an NPC function, but a level function. Change it to one of just triggeraction(), level.triggeraction() or this.level.triggeraction(). The NPC needs a Clientside setshape() in order to receive the triggeraction as well.