How do I...give a certain amount of X item based on a variable?

Context:

There's an NPC at the end of the game that you can dump all your leftover items onto, and he'll do a cheap conversion for money in exchange for all of the remaining items. (Money in this game is also an item, but he won't count those of course).

The conversion is this:
+1 (Money) for every item, no matter how valuable it was to other game outlets.
Screen Shot 2021-07-07 at 12.13.47 PM.png

So basically, the way I did it was that the NPC would count (and increment) every single possible item through the variable in the screenshot called "How many items?". After which, you can choose deal or no deal.
If you choose deal, what I want to happen is for him to give you the (Money-item) that's equivalent to the variable he added from totaling up all the items in your inventory...I'm just not sure how to tell the game to that.



Any suggestions?
When you use the "change items..." command (Page 1 of the event menu under "party"), you can already designate a variable to use as the amount.

Then you can input variable 199 which already contains the number you need.
use the change item command - that is its purpose

EDIT: ninja'd
Eyy that was swift! Sometimes I forget where variable options are, ahahah. Thanks guys 🙂

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-give-a-certain-amount-of-x-item-based-on-a-variable.138228/