Storing Items event using variables and conditions

Hello. I'm able to set up a deposit & withdraw system for items, just like how I event a bank. But if the player has 99 of one item and withdraws 99 from storage, they lose that 99 in storage since they can't hold anymore.

How do I set up a work around? I'm using the Event Command "Change Items" alongside an input number that uses a variable so I can store.

◆Input Number:Storage(Deposit/Withdraw), 2 digits


Thank you for reading.
Hmmm, if your player item count + input number > 99, then you set the input number to 99 - player item count
edit: when withdrawing
I think I evented it for you though in another thread how to do that.
if not, check the item count and the variable if is < than 99 total.

if it's over 99, show a message that they need to pick another number
or if value 99 - item count = max variable number as you can clamp it from there.

so if they have 80 items and 99 on bank, the max number they can pick = 19,
and not 99.
I think I evented it for you though in another thread how to do that.
if not, check the item count and the variable if is < than 99 total.

if it's over 99, show a message that they need to pick another number
or if value 99 - item count = max variable number as you can clamp it from there.

so if they have 80 items and 99 on bank, the max number they can pick = 19,
and not 99.

You're right! Thank you. I found my old thread.

And thank you everyone. ^_^

Original thread: https://forums.rpgmakerweb.com/threads/storing-items-event-using-variables-and-conditions.174782/