local moveSpeed = 150 local followDist = 200 function follow_player_init( e ) end function follow_player_main( e ) local Ent = g_Entity[ e ] local px, py, pz = g_PlayerPosX, g_PlayerPosY, g_PlayerPosZ local PDX, PDY, PDZ = Ent.x - px, Ent.y - py, Ent.z - pz if PDX*PDX + PDY*PDY + PDZ*PDZ > followDist * followDist then CollisionOff( e ) RotateToPlayerSlowly( e, 25 ) CollisionOn( e ) MoveForward( e, moveSpeed ) end end