Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review this topic, which shows all essentials of this board! Thanks!
what level is this @Zhekaman
var health = 0;
var strongestenemy = null;
while (true) {
var enemies = hero.findEnemies();
var friends = hero.findFriends();
for (var i = 0; i < enemies.length; i++) {
var friend = friends[i];
var enemy = enemies[i];
if (enemy.health > health) {
health = enemy.health;
strongestenemy = enemy;
}
}
if (friend) {
hero.command(friend, "attack", strongestenemy);
}
}