Mewtwo Strikes Back
So that means, the loaned Pokémon will always be the first and the Pokémon menu will be available when the script ends.
I see. Well, when I tried the routine on Ruby it worked fine, so it might have something to do with the special you used. So please send me the full script either via PM/VM.