• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Staff applications for our PokéCommunity Daily and Social Media team are now open! Interested in joining staff? Then click here for more info!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

check pokemon-type?

  • 8
    Posts
    9
    Years
    • Seen Sep 8, 2015
    Is there a Contitinal Branch or something, that can check if I have a curtain type of pokemon in my team?
     
    Add this in the scripts, in PSystem_Utilities. I have it right below the "pbHasSpecies?" function.

    Code:
    def pbHasPokemonType?(type)
      if type.is_a?(String) || type.is_a?(Symbol)
        type=getID(PBTypes,type)
      end
      for pokemon in $Trainer.party
        next if pokemon.isEgg?
        return true if pokemon.hasType?(type)
      end
      return false
    end

    you can then in the events, use, for example, "pbHasPokemonType?( :FIGHTING)" to test if the player has a Fighting type with them.
     
    Back
    Top