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