- 72
- Posts
- 6
- Years
- Seen Jan 24, 2021
Hello. I am trying to make a small script that runs when certain wild Pokemon is defeated.
To clarify, when a wild Pokémon of a certain species is defeated, something happens.
An example: When you defeat a wild Audino, all Pokémon in your party are healed.
The codes below are simple versions of what I was trying to do. The goal is when a Pachirisu is defeated, the message "You caught a Pachirisu." will appear. If not, "You did not catch a Pachirisu." will appear instead. But I do not know how exactly to ask that. The code I have tried to make is either ignored or returns an error. I was wondering if anyone could tell me what I am doing wrong. The help is greatly appreciated.
To clarify, when a wild Pokémon of a certain species is defeated, something happens.
An example: When you defeat a wild Audino, all Pokémon in your party are healed.
The codes below are simple versions of what I was trying to do. The goal is when a Pachirisu is defeated, the message "You caught a Pachirisu." will appear. If not, "You did not catch a Pachirisu." will appear instead. But I do not know how exactly to ask that. The code I have tried to make is either ignored or returns an error. I was wondering if anyone could tell me what I am doing wrong. The help is greatly appreciated.
Code:
if PBSpecies.getName(:PACHIRISU)
pbDisplay(_INTL("You caught a Pachirisu."))
else
pbDisplay(_INTL("You did not catch a Pachirisu."))
end
Code:
if pokemon.name = "Pachirisu"
pbDisplay(_INTL("You caught a Pachirisu."))
else
pbDisplay(_INTL("You did not catch a Pachirisu."))
end
Code:
if pokemon.species=(:PACHIRISU)
pbDisplay(_INTL("You caught a Pachirisu."))
else
pbDisplay(_INTL("You did not catch a Pachirisu."))
end