• 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] lose levels in pokemon if you lose a battle

Add this in a new section above main
Code:
Events.onEndBattle += proc { |_sender,e|
  decision = e[0]
  canLose  = e[1]
  if decision == 2 && !canLose
    $Trainer.party.each{|pkmn| 
       newLv = pkmn.level - (rand(3) + 1)
       newLv.clamp(1,PBExperience.maxLevel)
       pkmn.level = newLv
       pkmn.calcStats
    }
  end
}
 
Back
Top