found this old script:
NPC Code:
if(playerenters) {
this.angle=0;
this.radius=5; //radius from player
this.speed=.1; //rotation speed
timeout=.05;
}
if(timeout) {
x=playerx+cos(this.angle)*this.radius;
y=playery+sin(this.angle)*this.radius;
this.angle=this.angle+this.speed;
timeout=.05;
}