View Single Post
  #7  
Old 11-26-2015, 04:09 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by cbk1994 View Post
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.1this.1"Update""");
}

//#CLIENTSIDE
function onCreated()
  
this.setshape(13232);

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 View Post
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.
Reply With Quote