• 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?".
  • 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.

[Error] Error message + attack repeating with new ability.

35
Posts
3
Years
    • Seen Apr 23, 2024
    Trying to make a new ability that's basically Life Orb, keep getting an error when hit by a move that is followed by the other Pokémon using the move again.

    [Pokémon Essentials version 20.1] [v20.1 Hotfixes 1.0.7]

    Exception: NameError Message: undefined local variable or method `hitBattler' for nil:NilClass

    Backtrace:

    215:Battle_AbilityEffects:2265:in `block in <main>'

    035:Event_Handlers:227:in `trigger'

    215:Battle_AbilityEffects:233:in

    `triggerAfterMoveUseFromTarget'

    169:Battler_UseMoveTriggerEffects:196:in `block in

    pbEffectsAfterMove2'

    169:Battler_UseMoveTriggerEffects:193:in `each'

    169:Battler_UseMoveTriggerEffects:193:in `pbEffectsAfterMove2'

    169:Battler_UseMoveTriggerEffects:158:in `pbEffectsAfterMove'

    166:Battler_UseMove:503:in `pbUseMove'

    166:Battler_UseMove:52:in `block in pbProcessTurn'

    012:PBDebug:6:in `logonerr'

    And the code is:

    Battle::AbilityEffects::AfterMoveUseFromTarget.add(:UNSTABLECORE,

    proc { |ability, battler, battle|

    next if !hitBattler

    battle.pbShowAbilitySplash(battler)

    battle.scene.pbDamageAnimation(battler)

    battler.pbReduceHP(battler.totalhp / 8, false)
    battle.pbDisplay(_INTL("{1} was hurt by their {2}!",
    battler.pbThis))

    battle.pbHideAbilitySplash(battler)

    battler.pbItemHPHealCheck
    }

    )
     
    Back
    Top