Decoy Drill Help

I belive this code should work but my character never builds the decoys:

var decoysBuilt = 0;
while(true) {
var coin = this.findNearest(this.findItems());
if(coin) {
this.moveXY(coin.pos.x, coin.pos.y);
}
if (hero.coin >= 25) {
this.buildXY(“decoy”, coin.pos.x, coin.pos.y);

   decoysBuilt + 1;
}
if (decoysBuilt == 4) {
    break;
}

}

hero.say(“Done building decoys!”);
hero.moveXY(14, 36);
this.say(decoysBuilt);

please help.

hero.coin? Did you mean hero.gold?

2 Likes

Thank you, it works now! :slight_smile: