Did you try out this then event it?
http://galvs-scripts.com/2012/12/07/use-item-on-event/
That's what I used to make the demo.
The way I did it could be better.
Okay, make 3 items. Carrot, Onion, and Potato. Items 21 through 23.
Then event this process:
Spoiler
Conditional Branch: Script: key?🙂item,21) or key?🙂item,22) or key?🙂item,22)
Conditional Branch: Script: key?🙂item,21)
Variable Operation: [0002:item referring to] = 21
Variable Operation: [0003:current amount] = item 21 Carrot amount
Branch End
Conditional Branch: Script: key?🙂item,22)
Variable Operation: [0002:item referring to] = 22
Variable Operation: [0003:current amount] = item 22 Onion amount
Branch End
Conditional Branch: Script: key?🙂item,23)
Variable Operation: [0002:item referring to] = 23
Variable Operation: [0003:current amount] = item 23 Potato amount
Branch End
Display text: "What are you doing with this?"
Display Choices: I want to sell, It's for you, Nevermind
When [i want to sell]
Display text: "Okay, how much?"
Display text: "Choose an amount. You currently have \V[3]."
Label: start again
Numeric Input Processing: [0004:amount selected], 3 Digit(s)
Conditional Branch: Variable [0004:amount selected] > 0
Conditional Branch: Variable [0004:amount selected] >= Variable [0003: current amount]
Conditional Branch: Variable [0002:item referring to] == 21
Variable Operation [0005: money amount] = 6
Conditional Branch: Variable [0002:item referring to] == 22
Variable Operation [0005: money amount] = 5
Conditional Branch: Variable [0002:item referring to] == 23
Variable Operation [0005: money amount] = 10
Variable Operation: [0005: money amount] *= Variable: [0004: amount selected]
Display Text: "Okay, \.I can give you \V[5] Gold for that."
Display Choices: Yes, No
When [Yes]
Conditional Branch: Variable [0002:item referring to] == 21
Change Item: [Carrot] -= Variable [0004:amount selected]
Branch End
Conditional Branch: Variable [0002:item referring to] == 22
Change Item: [Onion] -= Variable [0004:amount selected]
Branch End
Conditional Branch: Variable [0002:item referring to] == 23
Change Item: [Potato] -= Variable [0004:amount selected]
Change Currency: + Variable [0005:amount of money]
Define Movement Route: Player (Wait)
$>Wait: 60 Frames
$>Play SE: 60 Frames
$>Wait: 40 Frames
When [No]
Display Text: "Thanks anyway."
Branch End
Branch End
Else
Display Text: "(It seems I have overestimated how much I have)"
Jump to Label: start again
Branch End
Else
Display Text: "Nevermind."
Branch End
Branch End
When [it's for you]
(I'll leave this up to you)
Branch End
When [Nevermind]
Display Text: "Alright. Have a nice day."
Branch End
Script: end_key
Branch End
Else
Display Text: "I can't do anything with that."
Branch End
Comment: <key>
then play and press the A key on your keyboard to access your items and S/D to scroll through types then select an item to sell.
A carrot will get you 5 gold per piece, an onion 4, and a potato 10.
If you select the amount to give him as 0, the hero will say nevermind.
If you select more than you have, then the amount-selection process will occur again.