Help with decoy drill

decoysBuilt = 0
while True:
coin = hero.findNearestItem()

if coin:
    hero.moveXY(coin.pos.x, coin.pos.y)
# Each decoy costs 25 gold.
# If is greater than or equal to 25:
if >=25:
    hero.buildXY("decoy", hero.pos.x, hero.pos.y)
    # Add 1 to the decoysBuilt count.
if decoysBuilt == 4:
    # Break out of the loop when you have built 4.

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

Say how many decoys you built.

when ever i type this in the decoy+=1 says it is not defined somebody pls help me


Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review this topic, which shows all essentials of this board! Thanks!

Make that decoysBuilt += 1, decoy is not defined, but decoysBuilt is defined.

1 Like

delete that passs(also change the topic title to level-help