Fixes the errors in doEnemyAttack script