I am trying to give the player a Pokedex when they beat a trainer. It works, however it works even when the player loses. You receive the Pokedex even after you lose and black out. How do I change it to only give you the Pokedex/any item upon winning only? Thanks!