- 132
- Posts
- 10
- Years
- New Brunswick
- Seen May 6, 2023
This is a script for storing a pokémon as a variable and then deleting it:
My question is, how do I change this to search for the 1st pokémon in the party, 2nd pokémon, 3rd, etc? Instead of searching for specifically pikachu, how can I incorporate $Trainer.party[0], for example? Seems like finding the pokémon's index isn't the best way to go about it, but I've tried other seemingly fail-proof methods that resulted in:
Thanks!
Code:
for i in 0...$Trainer.party.length
if isConst?($Trainer.party[i].species,PBSpecies,:PIKACHU)
$game_variables[42]=$Trainer.party[i]
pbRemovePokemonAt(i)
break
end
end
![[PokeCommunity.com] Another PKMN-Storing Question [PokeCommunity.com] Another PKMN-Storing Question](https://cdn.pbrd.co/images/H0E8Goy.png)
Thanks!
Last edited by a moderator: