Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Bank Script or Common Event?

I want a script or maybe a common event when there is a bank and you can take money out and put money into it by talking to an NPC. And i also want it so when you die you lose all the money that you didnt put into the bank which basically is like runescape.

can anyone help ? :boo:
 
You can create a banking system with events.
Here an example of one I just through together in VX I expect it should be similar or the same in XP....
You need to set 4 variable for it. One to keep track of how much...
- you are depositing [deposite]
- you are withdrawing [withdraw]
- gold you currently have [money]
- gold in the bank [bank]

Text: [Greeting]
Set a variable to = character's Gold
Choices [ex: deposite (1), withdraw (2), check balance (3), leave (4)]

1) deposite:
Input Number [deposite]
Conditional Branch (CB): Variable [Money] >= Variable [Deposite] #Makes sure you have enough money
Change Gold: - Variable [Deposite]
Change Variable: [Bank] += Variable [deposite]
Text: [confirmation / balances] ex: [you have deposited \v[n]. You balance is now \v[m]]
#where n = deposite's variable number & m = bank's variable number

2) withdraw:
Input Number [withdraw]
Conditional Branch (CB): Variable [bank] >= Variable [withdraw] #Makes sure you have enough money in the bank
Change Gold: + Variable [withdraw]
Change Variable: [Bank] -= Variable [withdraw]
Text: [confirmation / balances] ex: [you have withdrawn \v[n]. You balance is now \v[m]]
#where n = withdraw's variable number & m = bank's variable number

3) check balance:
Text: [ex: you have \v[n] in your account]
#n = variable number of bank

I expect you'll need a script to loose money when a player dies. You may need one to make you respawn as well cause getting a game over would mean you just reload with all your money. Sadly I probably won't be much help with those though cause I don't know how to script very well.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top