Quote:
Originally Posted by xAndrewx
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.x = 26;
player.y = 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.x > 63){
this.x -= 60;
}
function onMove()
{
this.x++;
if (this.x > 63)
{
this.x = 0;
}
schedulevent(0.05, "Move", "");
}