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
Please use credits
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