Add gold multiple based on variable

I want the reward to be 5 gold per crop, but you can harvest between 3-16 crops.

Is there a way to make each variable worth 5gold?

Something similar to:

Gold received = (Variable[Crop] * 5)

If that's possible
How do you have the event set up? Do you gain gold the instant you harvest a crop? Or do you have to 'sell' the crop? Are the crops an item?
How do you have the event set up? Do you gain gold the instant you harvest a crop? Or do you have to 'sell' the crop? Are the crops an item?
You have to harvest the crops, then sell them after you have harvested as many as you want.

I can't figure out the event to sell them and receive the appropriate amount.

The crops are an item as well as a variable. I just have the items removed when the gold is added as you arent selling them to a merchant in the shop interface, just an exchange between the characters.

Code:
@>Change Items: [Crops], - Variable [0002:Crops]
You can set a variable to the amount of a certain item you have in your inventory. Do this for the crops (game data > item in inventory), then remove the items using this variable. Use the same variable again and multiply it by 5 (for the gold), then simply use the 'change gold' command and use the variable this time for adding the correct amount of gold.


It should look something like this (I also added a conditional branch that checks if the player even has the crops in their inventory):


event_crops_zpslglysdqx.png



This only works for one certain crop though, if you have multiple (like potatoes and corn and whatnot), then it's best to simply have the shop command, so that the player can sell their crops there. Of course you can also go another route, and simply have a variable tracking how many crops the player has harvested (for all crops). I suggest you play the Variables Guide and get more acquainted with them.
You can set a variable to the amount of a certain item you have in your inventory. Do this for the crops (game data > item in inventory), then remove the items using this variable. Use the same variable again and multiply it by 5 (for the gold), then simply use the 'change gold' command and use the variable this time for adding the correct amount of gold.

It should look something like this (I also added a conditional branch that checks if the player even has the crops in their inventory):

[IMG]http://i1068.photobucket.com/albums/u453/celiannauploads/event_crops_zpslglysdqx.png[/IMG]

This only works for one certain crop though, if you have multiple (like potatoes and corn and whatnot), then it's best to simply have the shop command, so that the player can sell their crops there. Of course you can also go another route, and simply have a variable tracking how many crops the player has harvested (for all crops). I suggest you play the Variables Guide and get more acquainted with them.
Thanks so much, just what I wanted just wasn't sure how to do it! And I will definitely check that out, thanks for the help!

Original thread: https://forums.rpgmakerweb.com/threads/add-gold-multiple-based-on-variable.48296/