• 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!
  • Cyndy, May, Hero (Conquest), or Wes - 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.

[Battle✓] Want to create Trainer and have give item

  • 13
    Posts
    5
    Years
    • Seen Nov 20, 2023
    Hey I want to edit an existing person on map that gives you an item but want them to battle first then give item how do that
     
    Hey I want to edit an existing person on map that gives you an item but want them to battle first then give item how do that

    To do this, you'll first need to make a separate script that just involves the person giving the player the item. Next, you'll need to make sure that, when you initially interact with the person, they run either trainerbattle_single or trainerbattle_double. Pass in the trainer constant, their intro text, their lose text, and then pass in the name of that script you created where the person gives the player the item. It'll look something like this:
    Code:
    EventScript_Person::
    	trainerbattle_single TRAINER_PERSON, Text_PersonIntro, Text_PersonDefeat, EventScript_PersonGiveItem
    	[whatever stuff you want to happen if you can't battle them]
    	release
    	end
    
    EventScript_PersonGiveItem::
    	giveitem ITEM_WHATEVER
    	[whatever stuff you want to happen]
    	release
    	end
     
    Back
    Top