[SOLVED] Taunting Level Help

I did earlier but it showed an error.

1 Like

It says if you want to call ‘Elif’ as function, you need ‘()’ s

1 Like

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

1 Like

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

1 Like

1 Like

Mmmmk, I cant seem to figure out the problem.

Mumbo_6

I can not either (20 characters).

1 Like

Try putting the findNearestEnemy outside of the if-statement.

Mumbo_6

It is outside the if statement

Is it working?

Mumbo_6

No that’s what it does

1 Like

Oooooh I see the problem. You have to put munchkin and brawler in quotation marks.

Mumbo_6

1 Like

:grin: 200000 characters

1 Like

Okay (20 characters)

1 Like

If that does not work then I do not know.

Mumbo_6

1 Like

My hero still goes toward the explosives

Can you send me your updated code?

Mumbo_6

1 Like