[SOLVED] I am stuck on "Shine getter"


#1

Whenever I run my code it returns that it cannot read property ‘0’ of undefined for line coins = hero.findItems()

while True:
    
    coins = hero.findItems()
    coinIndex = 0 
    while coinIndex < len(coins):
        coin = coin[coinIndex]
        if coin.value == 3:
            pos = coin.pos
            x = pos.x
            y = pos.y
            hero.moveXY(x, y)
    coinIndex += 1


#2

the coinIndex+=1 is outside of the while loop

Also you said coin = coin[coinIndex]


#3

Thanks. It worked great.