• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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] Key Item to change Player Outfit

  • 15
    Posts
    6
    Years
    • Seen Mar 15, 2025
    Hello Community, I hope someone would be able to help me here. I've been working on a new Key Item for a while. My Goal is to have a Key Item that changes the Player Outfit.

    I can acheive that effect through scripts using theScript: $Trainer.outfit=X
    Where X resembles the Number of The Outfit under /Graphics/Characters

    However I have no idea how to let a Key Item trigger this Effect, there is no Item using a similiar function in PItem_Itemeffects.

    I was able to create a Key Item in the PBS Items file and give it to a player. It just doesn't have the wanted effect yet.

    How would I go from here on?

    I'd be thankful for advice or assistance.
     
    I actually want to know the exact same thing as the OP, so someone please hurry and help us out lol
    I definitely want my character to be able to wear a disguise allowing access to certain parts of the map that you wouldn't be able to normally access.
    Like sneaking into the evil team base disguised as a grunt.
     
    Code:
    ItemHandlers::UseInField.add(:CLOTHE1NAME,proc{|item|
       $PokemonBag.pbChangeItem(:CLOTHE1NAME,:CLOTHE2NAME)
       Kernel.pbMessage(_INTL("You changed your outfit"))
       $Trainer.outfit=1
    })
    
    ItemHandlers::UseInField.add(:CLOTHE2NAME,proc{|item|
       $PokemonBag.pbChangeItem(:CLOTHE2NAME,:CLOTHE1NAME)
       Kernel.pbMessage(_INTL("You changed your outfit"))
       $Trainer.outfit=0
    })

    >_>
     
    Last edited:
    This script works like a charm, thank you a lot!

    Short Installation Guide for other beginners:
    1. Create 2 Key Items in items.txt (tutorials for that are on youtube) - 1 can be your normal clothes, 2 can be a new outfit (your choice)
    2. Paste the script from Pokeminer20 into the scripts editor under PItem_ItemEffects below UseFromBag Handlers
    3. Replace Clothenames inside the script with the internal name of your clothes (for example you defined the casual clothes as "CASUAL" so you replace it with "CASUAL"
    4. Add a way to give the player the key item, save, and done!
     
    Back
    Top