View Single Post
  #1  
Old 09-03-2012, 02:56 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Triggeraction Difficulties

I have been playing around with a script, but I am having problems. I try to drag the NPC using this script but it only triggers if I mouseup on the same spot it origonally was.. which is odd.. and when it triggers.. it triggers every NPC that is joined to the class.. anyone got any ideas whats wrong o.O

PHP Code:
function onActionServerside(commandnxny) {
  
chat command;
}

//#CLIENTSIDE
function onCreated() {
  
this.catchEvent(GraalControl"onMouseDragged""onMouseDragged");
  
setshape2(1getimgwidth(this.image), getimgheight(this.image));
}

function 
onMouseDown() {
  if ( 
mousex in |x,x+getimgwidth(this.image)/16| && mousey in |y,y+getimgheight(this.image)/16| ) {
    
this.ox mousex x;
    
this.oy mousey y;
    
this.candrag true;
    
// clicked on it
  
}
}

function 
onMouseUp() {
  
this.candrag false;
  
triggeraction(mousexmousey"Serverside""test");
}

function 
onMouseDragged(objmodmxmy) {
  if ( 
this.candrag true ) {
    
//triggeraction(x, y, "Serverside", "test");
    
mousex this.ox;
    
mousey this.oy;
  }

I have tried triggering at the following cords:
PHP Code:
this.oxthis.oy
mousex
mousey
x

With no luck, both before and after updating the x/y values.
Reply With Quote