• 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] [URGENT] Help me! How to modify this script?

[URGENT] Help me! I am about to release a version of my game and found a very horrible bug. It must be simple to solve but I don't know how to do it.
When my Pokémon passed out it sends the item to the backpack, but as soon as it revives, the same item remains held by it and ends up duplicating the same

Spoiler:


IT'S VERY URGENT, HELP ME PLEASE, I WILL GIVE CREDITS FOR THAT
 
Your code should only work on wild Pokemon, but it seems to also be working on your Pokemon. You need to fix this by changing this line:
Code:
if [email protected] && @pokemon.item >0 && showMessage
to this:
Code:
if [email protected] && @pokemon.item >0 && @index % 2 == 1


In addition, the "showMessage" check should only be when it's trying to display the message. Change this line:
Code:
@battle.pbDisplayPaused(_INTL("The wild {1} dropped\n{2} <icon=bagPocket#{pocket}> x 1!",@pokemon.name,itemname,@pokemon.item))
to this:
Code:
@battle.pbDisplayPaused(_INTL("The wild {1} dropped\n{2} <icon=bagPocket#{pocket}> x 1!",@pokemon.name,itemname)) if showMessage
 
Last edited:
Back
Top