Help with decoy drill

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

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

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

Say how many decoys you built.

hero.say(“4”)
when ever i type this in the decoy+=1 says it is not defined somebody pls help me

2 Likes

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