Need Help on cloudrip treasure

Guys getting two errors, please find the code as below"

var defendPoints = [{"x": 59, "y": 73},{"x": 97, "y": 53},{"x": 57, "y": 49},{"x": 94, "y": 71}];
var summonTypes = ["griffin-rider","archer","paladin","archer","archer","archer","griffin-rider","griffin-rider"];
var priorityType = ["headhunter","thrower","shaman"];
this.summonTroops = function() {
    var type = summonTypes[this.built.length % summonTypes.length];
    if(this.gold >= this.costOf(type)) {
        this.summon(type);
    }
};
this.commandTroops = function() {
    var friends = this.findFriends();
    for(var friendIndex=0; friendIndex < friends.length; friendIndex++) {
        var friend = friends[friendIndex];
        var point = defendPoints[friendIndex % defendPoints.length];
        if (friend && friend.type != "peasant"){
        this.command(friend, "defend", point );
        }
    }
};
this.commandPaladin = function(paladin){
    paladin = this.findNearest(this.findByType("paladin"));
    if (paladin && this.health < 1000){
    this.command(paladin, "cast","heal", this);
    } else {
        this.command(paladin, "shield");
    }
};    
loop{
var friends = this.findFriends();
for ( i=0; i<friends.length; i++){
    var friend = friends[i];
    if (friend && friend.type == "peasant"){
    var coins = friend.findNearest(friend.findItems());
        if (coins){
            this.command(friend, "move", coins.pos);
            }
        }
    }
 this.summonTroops();
 this.commandTroops();
 this.commandPaladin();
var nearest = this.findNearest(this.findEnemies());
if (nearest  ){
    this.attack(nearest);
    } else {
        this.moveXY(78, 60);}
  
}

  1. cannot summon paladin
  2. paladin cannot shield

using boss star 3

thanks in advance

Looks like this line is the culprit:

if (paladin && this.health < 1000){

Perhaps your hero’s health is always below 1000. Try using your hero’s maxHealth in the calculation. Also, you should check whether the paladin can cast the heal spell (wait for the spell to cooldown). E.g.:

if (paladin && paladin.canCast('heal') && this.health < this.maxHealth - 150){

I believe you need Boss Star 4 in order to summon Paladins.

ok but on same mountain with boss star 3 we can command them on “grim determination”

The requires for summoning and commanding are different
Example:

  1. Level 1 boss star can command archers and soldiers but can only summon soldiers
  2. Level 3 boss star can command paladins but it cannot summon them

The general rule of thumb is that you are able to command one tier higher than what you can summon. The My Dear Friends - Using the Boss Star thread explains this more in-depth—in fact, it objectively answers your question:

whops my bad :astonished:
still thanks for the help