Well when ever the ball machines x value and the players x value match up you can make it shoot. But that will make it so all you have to do is keep moving to avoid damage. So when its about to match up like obj_machine.x+30||obj_machine.x-30=obj_player.x. Then this will make the ai kinda do a lead off of the players left and right movements. But that will make them shoot too much because they are in a line right? So make them have a percentage chance to shoot. Also, since Thats two spots per enemy that the ai will shoot, make it so it can't shoot if it was shot in the last two seconds or something. I can't write the script for you here because Im on my phone but i trust you can do it. If not, pm Me and ill write it asap.