How to Create a Bank with a Deposit/Withdrawal System | Difficulty: 🟨

Introduction

In this guide I will be showing you how to create a bank system where players can deposit whatever amount of money they want, or withdraw it, again, choosing the amount each time. This does require a fair understanding of blocks and properties, but other than that it is pretty easy to understand.

Devices Needed

(This is for just the deposit system. The withdrawal system is basically the same thing with a few changes (which I will show). With the exception of the Inventory Item Manager and Properties, you will need double the rest to make both the deposit and withdrawal system)

1x Inventory Item Manager
3x Properties
5x Buttons
2x Text
1x Item Granter
2x Notifications

Instructions

First, place down an inventory item manager managing your currency (in my case, cash). Then, create a property named Money. Make sure it is a number property, and set the scope to player. Now make the inventory item manager update the Money property. This will just make it so the Money property is always tracking the amount of money the player has.
Place down another property, and name it Bank Money. This is the property that will store all of the player’s money that’s in the bank. Make it a number property, and set the scope to player.
Alright, now we will get started with the Deposit system. Place down yet another property (last one I promise), and name it Deposit/Withdrawal Amount. Again, make it a number property, and set the scope to player. This will store the amount that the player wants to deposit/withdraw.
Place down some text, and 4 buttons underneath it. The text should show 0. We will come back to the text to put some blocks in later.
Next, make the buttons display different number amounts. Three should be positive, one should be negative. It depends on your game for what these numbers should be, but in my game you get a decent amount of money, so I made the button amounts +50, +100, +500, and -100. These are the buttons the player presses to adjust the overall number (which will be displayed on the text) until it gets to the amount of money they wish to deposit.
As for the settings of the buttons, this is what one of them looks like:


The only thing that should change from button to button is the Button Message, and the Channel it’s Transmitting on.
This is what the overall setup should look like so far:
image
The three buttons at the top are +50, +100, and +500, while the bottom one is the -100, in case they accidentally made their number too high and wanted to bring it down.
Alright, now make sure each button is transmitting on a different channel, preferably with the number in the channel (so you can distinguish them). Now back to the text, where we will make 4 different blocks, one for each button. This is what the blocks should look like:
image
That was for the +100 button.
Here’s the block for the -100 button.
image
Hopefully you can see what it’s doing, but if you pressed the +100 button, it would add 100 to the Deposit/Withdrawal property, and then updating the text so the player can see the change. This way the player can use the buttons to tweak the number until it is at the amount they wish to deposit.
Ok, now place one more button off to the side, and place a text above it. All you have to do for the text is make it say “Done”. This creates the Done Button, the button players press when they’ve reached the number they wish to deposit into their bank account.
Great, now place down an item granter, and wire the button to the item granter. Button pressed → Run Wire Pulse Block. Make the item granter grant your currency (in my case cash), and create a block On wire pulse.
This is what the block should look like:
image
Ok, let’s go through what is happening here. First, the block checks that you really do have enough money to deposit. If you do, it adds your deposit amount to your bank money. Then, it takes away that amount of money from you. After that, it resets the Deposit/Withdraw Amount property, and finally sends on channel Deposit Complete.
Ok, now place down two notification devices. Make one send when receiving on “Deposit Complete”, and the other receive on “Not enough money”, the channel that sends if you don’t have enough money.
This is what I made the messages look like for each:
Deposit complete notification:
image
Not enough money notification:
image
These notifications just alert the player if A, their deposit was successful, or B, if they don’t have enough money to deposit that amount. If they don’t have enough money, they can just adjust the amount on the text until it is a valid number.
Oh, and one more thing, add one more block to the text that shows the deposit amount.
Screenshot 2023-08-14 11.28.17
That one. Make the block activate when receiving on “Deposit Complete”, and make it look like this:
image
Just as simple as that, this resets the text when the deposit has been completed.

And real quick, the withdrawal system is the same except with some minor changes, if you want to see each of the changes, click here:

Withdraw System Changes

Button changes:
Instead of making the button amounts +50, +100, +500, -100, I made them -50, -100, -500, +100. Just flip them around.
Text changes:
Yes, you have to create whole new blocks for each of the new withdrawal buttons, and this is what it should look like.
image
Yup, again you just flip it. Instead of adding them, you subtract them from the Deposit/Withdrawal Property.
Item Granter changes:
image
That is what the block should look like.
Notification changes:
“Withdrawal complete” notification:
image
“Not enough bank money” notification:
image

Summary

And that is it for the deposit/withdrawal system! Now your players can deposit their money, and withdraw it from the bank. I hope this guide helped, and if it did a :heart: would be appreciated. Have fun!

What Difficulty Should This Guide Be?
  • 0/10 or :white_large_square:
  • 1/10 or :blue_square:
  • 2/10 or :green_square:
  • 3/10 or :green_square:
  • 4/10 or :yellow_square:
  • 5/10 or :yellow_square:
  • 6/10 or :orange_square:
  • 7/10 or :orange_square:
  • 8/10 or :red_square:
  • 9/10 or :red_square:
  • 10/10 or :purple_square:
  • 11/10 or :black_large_square:
0 voters
15 Likes

This is pretty similar to the one here:

Otherwise, nice guide!

1 Like

Nice guide!

2 Likes

Great guide!

1 Like

Thanks everyone!

3 Likes

Awesome Guide! one quick Question when i withdraw 50 cash but i don’t have any cash in the bank it gives me 50 cash. How do i fix this?

Nice guide!

It shouldn’t be giving you the 50 cash. The WIthdraw Item Granter block should look like this:
image
This makes sure that you actually do have the money in your bank account, and if not, it sends on a channel that sends a notification.
If you do this, it shouldn’t give you money you don’t have in your bank account.

4 Likes

@Im_Pretty_Cool, nice guide! Just wondering, wasn’t depositing and withdrawing a system in this guide:

Ohhh ty i had a few errors in my blocks so ty again! This guide was extremely helpful and adds so much depth into my map. One more question, is it possible into a game overlay that can be accessed at anytime? Thanks, DoggGaming

1 Like

Yes! All you have to do is place a game overlay, and it should show up at the beginning by default. If it doesn’t, connect a lifecycle to a relay set to all players, then connect the relay to the overlay.

Yes, but in that guide you can only deposit a percent of your cash, or withdraw it all. In this guide, you can choose and adjust exactly the amount that you wish to deposit or withdraw.

3 Likes

I think he meant how to input this system into a game overlay, but not sure.

2 Likes

If you meant just putting a game overlay, just follow @NavyCatZ’s answer.
However, if you do want to put this system into a game overlay, here’s my suggestion:
What I did was make a game overlay that had a call to action button to either deposit or withdraw. If you pressed the deposit, it would teleport you to the deposit system with the buttons and text, etc. Same if you pressed the withdraw button in the overlay, except it would teleport you to the withdraw system. And it would teleport you back once you were done.
So, while this doesn’t put the systems directly into a game overlay, it does teleport you to the systems when you want to.
It is technically possible to put the +(number) buttons into a popup as call to action buttons, but the limit of 2 call to action buttons per popup is why I didn’t do this.

5 Likes

I bump!

Can you make this with Triggers instead of Buttons?

1 Like

Yes, triggers should work just fine instead of buttons.
And welcome to the community!

2 Likes

Welcome @JellyProductions!

1 Like

Thanks! I tried it and it worked!

2 Likes