- 232
- Posts
- 8
- Years
- Seen May 13, 2025
They helped me make a script that makes the trainer lose levels by losing games and going to the pokémon center.
But when I load a pokemon egg there is a bug because the game cannot identify it because it is level 0.
This is the level loss script.
Esse é o BUG que acontece comigo...
Can someone help me?
But when I load a pokemon egg there is a bug because the game cannot identify it because it is level 0.
This is the level loss script.
Spoiler:
Events.onEndBattle += proc { |_sender,e|
decision = e[0]
canLose = e[1]
if decision == 2 && !canLose
$Trainer.party.each{|pkmn|
newLv = pkmn.level - (rand(1) + 1)
newLv.clamp(1,PBExperience.maxLevel)
pkmn.level = newLv
pkmn.calcStats
}
end
}
decision = e[0]
canLose = e[1]
if decision == 2 && !canLose
$Trainer.party.each{|pkmn|
newLv = pkmn.level - (rand(1) + 1)
newLv.clamp(1,PBExperience.maxLevel)
pkmn.level = newLv
pkmn.calcStats
}
end
}
Esse é o BUG que acontece comigo...
Spoiler:
---------------------------
Error
---------------------------
Script '[Interpreter]' line 246: RuntimeError occurred.
Script error within event 15 (coords 7,12), map 80 (Centro Pokémon):
Exception: ArgumentError
Message: PokeBattle_Pokemon:119:in `level='The level number (0) is invalid.
***Full script:
pbWildBattle(::PBSpecies::LEDIAN,5,1,true,false)
Backtrace:
Interpreter:197:in `pbExecuteScript'
[LoseLevels]:8
[LoseLevels]:5:in `each'
[LoseLevels]:5
[LoseLevels]:1:in `call'
Event_Handlers:51:in `trigger'
Event_Handlers:46:in `each'
Event_Handlers:46:in `trigger'
PField_Battles:555:in `pbAfterBattle'
PField_Battles:278:in `pbWildBattleCore'
---------------------------
OK
---------------------------
Error
---------------------------
Script '[Interpreter]' line 246: RuntimeError occurred.
Script error within event 15 (coords 7,12), map 80 (Centro Pokémon):
Exception: ArgumentError
Message: PokeBattle_Pokemon:119:in `level='The level number (0) is invalid.
***Full script:
pbWildBattle(::PBSpecies::LEDIAN,5,1,true,false)
Backtrace:
Interpreter:197:in `pbExecuteScript'
[LoseLevels]:8
[LoseLevels]:5:in `each'
[LoseLevels]:5
[LoseLevels]:1:in `call'
Event_Handlers:51:in `trigger'
Event_Handlers:46:in `each'
Event_Handlers:46:in `trigger'
PField_Battles:555:in `pbAfterBattle'
PField_Battles:278:in `pbWildBattleCore'
---------------------------
OK
---------------------------
Can someone help me?