Ah, yes, a timeout of 0.1 CONSTANTLY without a real purpose does lag. However, 0.1 is MANY times faster than a person can see the difference in, so 0.25 or .5 work better for things that aren't like movement and such. When I did my chat NPC< I used a timeout of 1, because anyway it will lag, and it will compensate. If you are worried about an extra .9 or so seconds, get over it :P You do
NOT make a d/b NPC switch levels every 0.1 seconds x.X You obviously aren't comprehending the POINT of it! x.X You might make a pet, and the pet will find a player, you would do something like this:
NPC Code:
if (created)
{ for (i=0;i<allplayerscount;i++)
{ with (allplayers[i])
{ if (strequals(#a,Projectshifter))
{ setstring this.level,#F;
setstring this.x,strtofloat(playerx);
setstring this.y,strtofloat(playery);
}
}
}
timeout=0.25;
}
if (timeout)
{ x=strtofloat(#s(this.x));
y=strtofloat(#s(this.y));
if (!strequals(#L,#s(this.level))
{ setlevel #s(this.level);}
timeout=0.25;
}
of COURSE you would have it not be on top of the player, but it would be USELESS for me to post the entire coding here...
---Shifter