the problem could be because you created them at the my.x position of the first box, try using a random value, like:
Code:
action enemy_creator
{
var pos_;
////////set the maximum distance from the spawn box
var max_x_ = 300;
var max_y_ = 300;
var max_z_ = 0;
my.passable = on;
my.invisible = on;
while(1)
{
while(enemy_count < 5) //max_enemy_count = 5
{
vec_set (pos_.x, my.x);
pos_.x += random (max_x_) - random (max_x_ *1.5);
pos_.y += random (max_y_) - random (max_y_ *1.5);
pos_.z += random (max_z_) - random (max_z_ *1.5);
ent_create("speeder.mdl",pos_,enemy_flight);
enemy_count += 1;
}
wait(5);
}
}
i also changed the "if" to a "while" so that it should stop, although if it doesn't it'll create millions more, also, have you tried making max_enemy_count a local var instead?