• 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!
  • 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] what am I doing wrong?

  • 67
    Posts
    4
    Years
    • He/Him
    • Seen Nov 16, 2023
    So I've been working on a move that does double damage is the user or ally is grass type but it won't work or atleast when I test it on an npc trainer that has the same stats it doesn't work is there something I can do to make this work or does anyone know how I can fit a pbDisplay or something so that a message drops when the effect happens?

    ################################################################################
    # Power is boosted if ally or user is grass (Shimmer Ray)
    ################################################################################
    class PokeBattle_Move_223 < PokeBattle_Move

    def pbBaseDamage(basedmg,attacker,opponent)
    if attacker.pbHasType?(:GRASS) || attacker.pbPartner.pbHasType?(:GRASS)
    return basedmg*2
    return basedmg
    end
    end
    end
     
    You should mention which version of essentials you are using, but I am pretty sure you put the first end in the wrong place

    corrected
    Code:
    ################################################################################
    # Power is boosted if ally or user is grass (Shimmer Ray)
    ################################################################################
    class PokeBattle_Move_223 < PokeBattle_Move
       def pbBaseDamage(basedmg,attacker,opponent)
          if attacker.pbHasType?(:GRASS) || attacker.pbPartner.pbHasType?(:GRASS)
             return basedmg*2
          end
          return basedmg
       end
    end

    I haven't tested it yet, so you should probably tell me if it is working.
     
    You should mention which version of essentials you are using, but I am pretty sure you put the first end in the wrong place

    corrected
    Code:
    ################################################################################
    # Power is boosted if ally or user is grass (Shimmer Ray)
    ################################################################################
    class PokeBattle_Move_223 < PokeBattle_Move
       def pbBaseDamage(basedmg,attacker,opponent)
          if attacker.pbHasType?(:GRASS) || attacker.pbPartner.pbHasType?(:GRASS)
             return basedmg*2
          end
          return basedmg
       end
    end

    I haven't tested it yet, so you should probably tell me if it is working.

    Thanks I'm gonna test this right now and essentials version is something I forget to include a lot my bad
     
    Back
    Top