• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] this script was made for v18 to lower pokemon levels by losing battles??

Sadly no, I have tried to get that working for a few projects now and have had no luck being able to get it to work.

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.
Spoiler:


Esse é o BUG que acontece comigo...
Spoiler:


can you help me?
 
Try this, not tested.
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) if !pokemon.isEgg?
newLv.clamp(1,PBExperience.maxLevel) if !pokemon.isEgg?
pkmn.level = newLv if !pokemon.isEgg?
pkmn.calcStats
}
end
}
 
Try this, not tested.
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) if !pokemon.isEgg?
newLv.clamp(1,PBExperience.maxLevel) if !pokemon.isEgg?
pkmn.level = newLv if !pokemon.isEgg?
pkmn.calcStats
}
end
}


I managed to correct, thanks!
Hey, do you know the FL HUD? On Page 2 he tells how to add a keyboard key to activate and deactivate a Switch. But I tried to do it on v18 and I was unsuccessful ... Could you tell me how? I tried with the standard Essentials buttons, I tried to create more compatible keys and I did. But when pressing them has no effect, would you know how to tell me how to add a key that activates and deactivates a Switch?
It could be Number 1 on the keyboard, it would be great
 
Back
Top