# Decoy Drill Help

**URL:** <https://discourse.codecombat.com/t/decoy-drill-help/7428>\
**Category:** Solved\
**Created:** [May 3, 2016, 7:00pm UTC](https://discourse.codecombat.com/t/decoy-drill-help/7428 "2016-05-03T19:00:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FuzzyCheese](https://avatars.discourse-cdn.com/v4/letter/f/2bfe46/32.png) [@FuzzyCheese](https://discourse.codecombat.com/u/FuzzyCheese)\
**Post date:** [May 3, 2016, 7:00pm UTC](https://discourse.codecombat.com/t/decoy-drill-help/7428/1 "2016-05-03T19:00:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Serg](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/serg/32/3260_2.png) [@Serg](https://discourse.codecombat.com/u/Serg)\
**Post date:** [May 3, 2016, 8:16pm UTC](https://discourse.codecombat.com/t/decoy-drill-help/7428/2 "2016-05-03T20:16:22Z")

</div>

`hero.coin`? Did you mean `hero.gold`?

---

<div class="post-metadata">

**Author:** ![FuzzyCheese](https://avatars.discourse-cdn.com/v4/letter/f/2bfe46/32.png) [@FuzzyCheese](https://discourse.codecombat.com/u/FuzzyCheese)\
**Post date:** [May 4, 2016, 1:39am UTC](https://discourse.codecombat.com/t/decoy-drill-help/7428/3 "2016-05-04T01:39:31Z")

</div>

Thank you, it works now! 🙂
