As you can see when I attack an enemy it attacks them both. If I don't select an enemy at the start it will produce an error. When I kill them both it only gives me xp for one enemy.
If you're using the variable health, don't.
If you're doing something like oEnemy.hp-=10 then you need to make sure the part on the left is an instance ID, not an object ID.
Like how TheouAegis has suggested. In the attack obj, run a with command which will run the code for each instance of obj enemy. Each instance of obj enemy will know if it was selected or not by checking enemy_selected