So I'm trying to create an NPC that evolves your trade-evolving Pokemon for you. When I'm testing it, Pokemon that don't need an item(I'm using Graveler) evolve just fine, but for those who do need an item(I'm using Poliwhirl w/ King's Rock), the evolution scene has no sprite for the evolved form and then says Poliwhirl evolved into Genesect, which I believe is the last Pokemon on the list. After that I get the error in the image given.
Just as a note, I changed the parameters for pbTradeCheckEvolution so that pokemon2 defaults to nil since there's no actual trade happening. Other than that, no changes to the script have been made.
Any help would be much appreciated, thanks!