@ FoxHound - Ok thanks for that advice. I'll remember that. I found out which parts of the script aren't running, so thanks for that

@ Redeemer - Right, that makes sense. Thanks. I may have more questions yet though...
EDIT: This isn't working. After using beep, the same two parts aren't working - action state_enemy and function state_attck (the enemy's event)
Here's the code for the two
function state_attack ()
{
if (event_type == EVENT_DETECT)
{
vec_set(temp,player.x); //you is the player
vec_sub(temp,my.x); //me is the bad buy
vec_to_angle(my.pan,temp); // now MY looks at YOU
c_move( me,vector( 4 * time_step,0,0 ), nullvector,GLIDE );
}
}
action enemy_act ()
{
my.emask |= EVENT_DETECT;
my.event = state_attack;
while( my )
{
state_wait ();
wait (1);
}
}