Heya folks, I was looking to have a man selling a key, but am not quite sure how to make it so that he doesn't have an unlimited supply of said key that can be bought over and over again. Am I just overlooking something in the menus, or is this elaborate feature not in RMXP?
Cheers for any help.
The simplest way would be by using a variable.
Set a variable (and name it) with a value equal to the maximum number of the item that you want to sell. For the sake of this example, let us say it is 3.
Conditional branch:
Can I buy a thingy?
Check variable = greater than 0.
If yes, sell, remembering to remove the amount of gold needed.
Reduce the variable by one.
So next time the variable will be equalling 2.
The player can repeat this twice more.
Once the variable = zero, the 'Else' branch kicks in
"Sorry, I've no more in stock."