I did earlier but it showed an error.
It says if you want to call ‘Elif’ as function, you need ‘()’ s
Try that and also try to delete the if statement in the elif statement, since you defined it in elif. Elif stands for else-if.
Mumbo_6
Elif is not a function, its an if-statement
Mumbo_6
while True:
# If enemy.type is “munchkin”:
if enemy and enemy.type == munchkin:
enemy = hero.findNearestEnemy()
# Then attack it:
hero.attack(enemy)
# If the enemy’s type is “brawler”:
elif enemy.type == "brawler":
# Then say something to call the brawler"
hero.say("I don't think so brawler")
pass
My hero still is not attacking
Do you have a sword or a hammer equipped? Can you send me a screenshot of your equipment?
Mumbo_6
Okay give me one second
Mmmmk, I cant seem to figure out the problem.
Mumbo_6
I can not either (20 characters).
Try putting the findNearestEnemy outside of the if-statement.
Mumbo_6
It is outside the if statement
Is it working?
Mumbo_6
Oooooh I see the problem. You have to put munchkin and brawler in quotation marks.
Mumbo_6
200000 characters
Okay (20 characters)
If that does not work then I do not know.
Mumbo_6
My hero still goes toward the explosives
Can you send me your updated code?
Mumbo_6