As soon as my hero builds 1 decoy, the loop gets broken and he goes tell the NPC he’s build 4 decoys. I have no idea why. The tutorial video uses Decoys build += 1 instead of + 1, but I get an error code when trying that and I’m not sure what the difference is.
Cheers.
decoysBuilt = 0
loop:
coin = self.findNearestItem()
coinpos = coin.pos
selfpos = self.pos
self.moveXY(coinpos.x, coinpos.y)
if self.gold >= 25:
self.buildXY("decoy", selfpos.x, selfpos.y)
decoysBuilt = decoysBuilt + 1
if decoysBuilt = 4:
break
self.say("Done building decoys!")
self.moveXY(14, 36)
self.say("ey yo I've build " + decoysBuilt + " decoys hook me up with those gems")