Sarven Sentry Help [Python] [Solved]

I’ve been trying this again after times of fail and reduction from my code
hopefully y’all can help me out find whats wrong with the problem in my code

while True:
    flagGreen = hero.findFlag("green")
    flagBlack = hero.findFlag("black")
    
    # If there's a flagGreen...
if flagGreen:
    
    # Build a "fence" at flagGreen's position.
    hero.buildXY("fence", flagGreen.pos.x, flagGreen.pos.y)
    hero.pickUpFlag("green")
    # Pick up the flag!
    
    # If there's a flagBlack...
    if flagBlack:
        
        hero.buildXY("fire-trap", flagBlack.pos.x, flagBlack.pos.y)
    hero.pickUpFlag("black")
    
    hero.moveXY(43, 31)

Your if-statement for the green flag is not in your loop.

i see it worked thank you

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