Quote:
Originally posted by nyghtGT
its probably laggy and not very good but try this sucka:
NPC Code:
NPC Code:
if (created) {
timeout=1;
}
if (timeout) {
this.oldx=this.newx;
this.oldy=this.newy;
this.newx=playerx;
this.newy=playery;
if ((this.newx==this.oldx)&&(this.newy==this.old)) {
message Player Did Not Move!;
}
timeout=1;
}
thats just a little bit, but toy with it ...
|
umm that wouldnt work I dont think because it set the oldx and y before it messages anything or does anything, so it would always stay player did no move if im not mistaken, heres how i would do this
NPC Code:
if (playereneters) {
timeout=1;
}
if (timeout) {
if ((playerx==this.playeroldx)&&(playery==this.player oldy)) {
this.idletime++;
message Idle for #v(this.idletime);
}
if ((!playerx==this.playeroldx)||(!playery==this.play eroldy)) {
this.idletime=0;
message;
}
this.oldx=playerx;
this.oldy=playery;
timeout=1;
}
would this work?