Hi AnseDra can u help me on another level though because I have no idea what code to use for Clash of Clones Sarven Desert the final level.
You could create a new topic with the name of the level and the code in it, so I will be able to help you.
// Fight enemies for 15 seconds.
// Keep count whenever an enemy is defeated.
var count=0;
while (true) {
var enemy = hero.findNearest(hero.findEnemies());
if (enemy) {hero.attack(enemy); count++;}
if(hero.now() > 15) break;
}
// Tell Naria how many enemies you defeated.
hero.moveXY(58, 33);
hero.say(count);
// Collect coins until the clock reaches 30 seconds.
while (true) {
var item = hero.findNearest(hero.findItems());
hero.moveXY(item.pos.x, item.pos.y);
if(hero.now() > 30) break;
}
// Tell Naria how much gold you collected.
hero.moveXY(58, 33);
hero.say(hero.gold);
// Fight enemies until the clock reaches 45 seconds.
// Remember to reset the count of defeated enemies!
var count1=0;
while (true) {
enemy=hero.findNearest(hero.findEnemies());
if (enemy) {hero.attack(enemy); count1++;}
if(hero.now() > 45) break;
}
// Tell Naria how many enemies you defeated.
hero.moveXY(58, 33);
hero.say(count1);