View Single Post
  #3  
Old 05-31-2007, 04:31 PM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Quote:
Originally Posted by xAndrewx View Post
Well, you need to check it when the npc is moving... Here's how!
HTML Code:
function onMove()
{
  this.x++;
  if (this.x > 63)
  {
    this.x = 0;
  }
  schedulevent(0.05, "Move, "");
}
he still just walks into the wall
this is my whole script:
PHP Code:
// Graal2002 NPC by Stefan Knorr
if (created) {x+=.5;
  
// Initialize the attributes
  
showcharacter;
  
setcharprop #3,head9.png;
  
setcharprop #C0,white;
  
setcharprop #C1,black;
  
setcharprop #C2,black;
  
setcharprop #C3,black;
  
setcharprop #C4,black;
  
setcharprop #n,Agent;
  
setcharprop #2,no-shield.gif;
  
shieldpower 1;
  
dir 0;
}
if (
playertouchsme) {
message FBI only!;
player.26;
player.41;
player.chat "Busted.";
sleep 1.5;
message ;
}
if (
created || movementfinished) {
setcharani walk,;
radangle random(1*3.14);
dx cos(radangle);
dy = -sin(radangle);
move dx*5,dy*5,.5,4+8+16;
}
if (
this.63){
this.-= 60;
}
function 
onMove()
{
  
this.x++;
  if (
this.63)
  {
    
this.0;
  }
  
schedulevent(0.05"Move""");

__________________
**FLIP OUT**
Reply With Quote