View Single Post
  #9  
Old 10-27-2013, 11:00 PM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
PHP Code:
function onCreated() {
  
this.owner = null;
  
this.ani = "grab";
  
setshape( 1, 16 * 5, 16 * 5);
}

function 
onInitialize(playername) {
  
this.owner = playername;
  
triggeraction(this.x + .5, this.y + .5, "Test", null);
  
onTimeOut();
}

function 
onPlayerChats() {
  if (
player.chat == "bye") {
    
destroy();
  }
}

function 
onActionRightMouse() {
  
destroy();
}

function 
onTimeOut() {
  if (
max(this.owner.x, this.x) - min(this.owner.x, this.x) > 5) this.x += 1;
  if (
max(this.owner.y, this.y) - min(this.owner.y, this.y) > 5) this.y += 1;
  
setTimer(.05);
}

//#CLIENTSIDE
function onCreated() {
  
setshape( 1, 16 * 5, 16 * 5);
}

function 
onActionTest() {
  
scheduleevent(.05, "showPoly");
  
player.chat = ":D";
}

function 
showPoly() {
  
with(findimg(200)) {
    
polygon = {
      
this.x - 5, this.y - 5,
      
this.x + 5, this.y - 5,
      
this.x + 5, this.y + 5,
      
this.x - 5, this.y + 5
    
};
    
red = green = blue = 0;
    
alpha = .6;
    
layer = 3;
  }
} 
I know that onCreated is there twice but it seems to those parts seem to work fine.
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!



Last edited by Astram; 10-27-2013 at 11:00 PM.. Reason: Fixed something
Reply With Quote