The following error keeps occuring in this function and others like it that are similar, I cannot seem to figure out why, does anyone have a solution?
def rare_func():
rare_chance = random.randint(1, 151)
if rare_chance < 91:
rare = Rare_Rewards[3]
elif rare_chance >= 106 and not rare_chance > 114:
rare = Rare_Rewards[0]
elif rare_chance >= 114 and not rare_chance > 146:
rare = Rare_Rewards[4]
elif rare_chance >= 146 and not rare_chance > 147 :
rare = Rare_Rewards[2]
elif rare_chance > 147:
rare = Rare_Rewards[1]
print("Opening...")
pygame.time.wait(1000)
ra_background = True
print("")
#pickup_audio.play()
print("You got a [RARE] Chest and inside is: " + str(rare))
#rare_audio.play()
print("")
I tried adding the global
variable which was a solution in another post with the same occurring issue and some other minor tweaks and expected it to entirely go away but like I said earlier it just keeps occurring randomly.
New contributor
Easton Gardner is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.