Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

I can't figure out rich forager

it keeps saying: Can’t read property “pos” of null. here’s my code. Screenshot 2021-09-13 08.54.51

Try this:

item = hero.findNearestItem()
if item:
     itemPos = item.pos
2 Likes

I don’t know python very well but i think you need to change the Pos to pos idk :woman_shrugging:

Yes, you would need to check if an item exists before defining itemPos as the item’s position.