• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Simple bank system

zingzags

PokemonGDX creator
  • 536
    Posts
    16
    Years
    In your settings add this
    BALANCE=X where "X" is the game variable which holds the data which is used for the bank.
    Just call pbDeposit, or pbWithdraw in an event.
    Enjoy

    Code:
    class Bank
    
    def pbDeposit
    params=ChooseNumberParams.new
    params.setRange(1,$Trainer.money)
    params.setInitialValue($Trainer.money)
    params.setCancelValue(0)
    qty=Kernel.pbMessageChooseNumber(_INTL("Teller: How much would you like to deposit?"),params)
    newmoney=$Trainer.money-qty
    store=$Trainer.money-newmoney
    $game_variables[BALANCE]=$game_variables[BALANCE]+store
    $Trainer.money=newmoney
    end
    
    def pbWithdraw
    params=ChooseNumberParams.new
    params.setRange(1,$game_variables[BALANCE])
    params.setInitialValue($game_variables[BALANCE])
    params.setCancelValue(0)
    qty=Kernel.pbMessageChooseNumber(_INTL("Teller: How much would you like to withdraw?"),params)
    newmoney=$Trainer.money+qty
    remove=$game_variables[BALANCE]-qty
    $game_variables[BALANCE]=remove
    $Trainer.money=newmoney
    end
    
    end
    
    class BankScreen
     def initialize(scene)
      @scene = scene
     end
     def pbStartScreen
       @scene.pbDeposit
     end
     def pbStartScreen2
       @scene.pbWithdraw
     end
    end
    Please use credits
     
    Thank you very much for this,this will be very handy indeed.
     
    lol looks like a similar script i made for money storage with the players mother

    def withdrawmommoney
    params=ChooseNumberParams.new
    params.setRange(0,$game_variables[30])
    params.setInitialValue(1)
    params.setCancelValue(0)
    qty=Kernel.pbMessageChooseNumber(
    _INTL("How much to withdraw."),params
    )
    if qty>0
    $Trainer.money+=qty
    $game_variables[30]-=qty
    Kernel.pbMessage(_INTL("${1} was added.",qty))
    else
    Kernel.pbMessage(_INTL("no money was added."))
    end
    end

    def depositmommoney
    params=ChooseNumberParams.new
    $game_variables[31]=$Trainer.money
    params.setRange(0,$game_variables[31])
    params.setInitialValue(1)
    params.setCancelValue(0)
    qty=Kernel.pbMessageChooseNumber(
    _INTL("How much to deposit."),params
    )
    if qty>0
    $Trainer.money-=qty
    $game_variables[30]+=qty
    Kernel.pbMessage(_INTL("${1} was stored.",qty))
    else
    Kernel.pbMessage(_INTL("no money was stored."))
    end
    end

    def mommoney
    Kernel.pbMessage(_INTL("You have ${1}",$game_variables[30]))
    withdrawmommoney
    depositmommoney
    end
     
    Back
    Top