Quote:
Originally posted by BocoC
Try something like this:
NPC Code:
if (created) timeout=0.05;
if (timeout) {
if ((abs(this.px-playerx)>0.6)||(abs(this.py-playery)>0.6)) {
playerx=this.px;
playery=this.py;
}
this.px=playerx;
this.py=playery;
timeout=0.05;
}
That should work. Since a player moves a max of 0.6 tiles every 0.5 seconds (level 3 shield), it checks if a player goes faster. You can modify upon it if you want.
|
[Kaimetsu]
Nope, won't work. Wanna know why? Because on a speed-hacked computer, timeouts run faster than normal too. You might get 40 timeouts per second, so even if you were running at the normal distance-per-timeout, you'd still be going fast.
[/Kaimetsu]