- 232
- Posts
- 8
- Years
- Seen May 13, 2025
This Script causes your team's Pokémon to lose levels by passing out and going to the Pokémon Center. But when you have a level 1 Pokémon in the Team and you lose, there is a crash, would anyone know how to solve it?
Events.onEndBattle += proc { |_sender,e|
decision = e[0]
canLose = e[1]
if decision == 2 && !canLose
$Trainer.party.each{|pkmn|
if !pkmn.isEgg?
newLv = pkmn.level - (rand(1) + 1)
newLv.clamp(1,PBExperience.maxLevel)
pkmn.level = newLv
pkmn.calcStats
end
}
end
}
Events.onEndBattle += proc { |_sender,e|
decision = e[0]
canLose = e[1]
if decision == 2 && !canLose
$Trainer.party.each{|pkmn|
if !pkmn.isEgg?
newLv = pkmn.level - (rand(1) + 1)
newLv.clamp(1,PBExperience.maxLevel)
pkmn.level = newLv
pkmn.calcStats
end
}
end
}