UnboundLocalError: local variable 'gold' referenced before assignment

...

if chooseItem == "1":
                gold, arrows, whip, cannnonballs, heartPotions, megaHeartPotion, infinityPotion, infinityXPotion, duelBloodXXHealer, bloodXHeal, energyYPotion, basicRainbowHealer = bloodXHealerZZ.buy(gold, arrows, whip, cannnonballs, heartPotions, megaHeartPotion, infinityPotion, infinityXPotion, duelBloodXXHealer, bloodXHeal, energyYPotion, basicRainbowHealer)

Recommended Answers

All 4 Replies

Can you be more precise? Please.

never mind I got it
thanks anyway!!

When you call
bloodXHealerZZ.buy(gold, arrows, whip, ...)
you need to have a value for gold, arrows, whip, and so on.

"gold", "arrows", "whip"

you forgot to put into double quotes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.