[SOLVED] Loud quietness hlp

here is my current code

# Get the volume and the password.

def onHear(event):
    # Get the volume and the password.
    words = event.message.split(" ")
    volume = words[0]
    password = words[1]
    # If the password should be loud:
    if volume == "Loud":
        # The pet says it in UPPER CASE.
        pet.say(words[1].toUpperCase())
    # If the password should be quiet:
    if volume == "Quiet":
        # The pet says it in lower case.
        pet.say(words[1].toLowerCase())
    pet.moveXY(pet.pos.x+ 24, pet.pos.y)

def passDoor():
    guard = hero.findNearest(hero.findFriends())
    password = guard.password
    # If the password should be loud:
    if guard.isLoud:
        # Use the .toUpperCase() method on the password.
        hero.say(password.toUpperCase())
        pass
    # If the password should be quiet:
    elif guard.isQuiet:
        # Use the .toLowerCase() method on the password.
        hero.say(password.toLowerCase)
        pass
    hero.moveXY(hero.pos.x+ 24, hero.pos.y)

# The pet can hear guards.
pet.on("hear", onHear)
# The hero should use their properties.
hero.moveXY(10, 14)
passDoor()
passDoor()

what am i doing wrong? the hero cant get through the first door. @AnSeDra @dedreous @Deadpool198 plz

1 Like

You are missing brackets.

1 Like

where do i put the brackets? @MidnightWolf39?

1 Like

What’s the difference?

1 Like

cool thanks :smiley: sorry for asking im dumb sometimes

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.