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.