• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our next favorite protagonist poll is for the Fiore region, from Pokémon Ranger 1! This poll is only lasting 2 days, so don't forget to cast your vote for your favorite Fiore protagonist before it's over!
  • 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.

[Scripting Question] Making an item

  • 1
    Posts
    5
    Years
    • Seen Jul 15, 2020
    Hello. So I want to create a held item that increases the user's defense by 20% whilst being held. However, it only boosts the defense if the opponent's attack is of electric, flying or bug type.

    I'm having trouble with the last part, if anyone knows if its possible to program this and could help me out:

    My script up 'till now:

    if opponent.hasWorkingItem(:QUARTZCRYSTAL) && pbIsPhysical?(type)
    defmult=(defmult*1.20).round

    Thanks in advance!
     
    So instead of pbIsPhysical?(type) you want to check if type is electric, flying, or bug? Maybe look at how things like Cell Battery check the type? :)
     
    You need to add
    Code:
     && (isConst?(type,PBTypes,:ELECTRIC) || isConst?(type,PBTypes,:FLYING) || isConst?(type,PBTypes,:BUG))
     
    Back
    Top