[Solved] Need Help With Paldins!


#1

So, Right Now I’m On Summits Gate And I’m Trying To Make My Paldins Heal Me, but unlike Grim Determination My Paldins Aren’t Healing me!! Below Is My Code, At The Far Bottom Is The Paldin Code:

// Fight your way into the Inner Sanctum of the ogre chieftain, and defeat her.
while(true) {
    var enemy = hero.findNearestEnemy();
    if (enemy) {
        hero.attack(enemy);
    }
    var flag = hero.findFlag();
    if (flag) {
        hero.moveXY(flag.pos.x, flag.pos.y);
        hero.pickUpFlag(flag);
    }
    if (hero.isReady("heal")) {
        hero.heal(hero);
    }
    if (hero.isReady("throw")) {
        hero.throw(enemy);
    }
    if (hero.gold > 20) {
        hero.summon("soldier");
    }
    var friend = hero.findFriends();
    for(var i = 0; i < friend.length; i++){
        hero.command(friend[i], "attack", enemy);
    }
    var paldin = hero.findByType("paldin");
    if (paldin) {
        for(var o = 0; o < paldin.length; o++){
        hero.command(paldin[o], "cast","heal", hero);    }
    }
}

Help me Please! I keep Dieing At The 3rd Gate Because Of This!


#2

What boss star do you use?


#3

I used Boss Star 3! But It Wont work


#4

You forgot to indent and forgot the a in paladin.
I guess thats it. Tell me if you still can’t solve it. I’ll try my best.

var paldin = hero.findByType("paldin");
    if (paldin) {
        //indent!
        for(var o = 0; o < paldin.length; o++){
        //indent here too
        hero.command(paldin[o], "cast","heal", hero);    }

#5

Sadly It Wont Work @Chaboi_3000


#6

Did you indent the other places too?


#7

Never Mind. Its Working! Thank You!


#8

your welcome!!! :smiley::smiley::smiley:


#9

Again Thank You! I Just Beat The Level because Of Your Help!!! :wink: