For the target to follow the enemy around, I'd try this:

Code:

var enemy_handle; // a global handle we can use for transferring pointers

function event_scn()
{
if (event_type == event_scan)
{
enemy_handle = handle(you);
ent_create(lockon, my.x, got_target);
}
}

function got_target
{
my.scale_x = 0.1;
my.scale_y = my.scale_x;////scale the sprite so it`s no huge
you = ptr_for_handle(enemy_handle); // now YOU is the enemy
while(you)
{
vec_set(temp,player.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp); // turn the target toward the player

vec_set(temp,nullvector);
temp.x = 20; // change this if you need to - the distance in front of the enemy
vec_rotate(temp,my.pan);
vec_add(temp,your.x);
vec_set(my.x,temp);

wait(1);
}

}



The temp.x = 20 line might need to be temp.x = -20, but I'm not sure, I haven't done the math. Test that and see how it serves you.