View Single Post
  #4  
Old 06-14-2004, 12:23 AM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
I have attached a baddy script - it uses the move command. I made it initially for archaic, but it should help you.

But to the point:

NPC Code:

tx = targetx - x;
ty = targety - y;
dist = (tx*tx+ty*ty)^0.5;
nx = (tx/dist)*walkspeed;
ny = (ty/dist)*walkspeed;



Edit:

Then simply use
NPC Code:

move nx,ny,walkspeed,1+4+8;



etc.

Hope It helped
Attached Files
File Type: txt baddy.txt (3.6 KB, 258 views)
__________________
Former Global Scripting Team Member



Last edited by Ningnong; 06-14-2004 at 01:14 PM..
Reply With Quote