Black Eternity
Lord of Eternity
- 57
- Posts
- 11
- Years
- Seen Jun 30, 2016
#This post has been edited since the script has been completed to my standards.
#Thanks to Maruno for help
The full script is here: http://www.pokecommunity.com/showthread.php?t=299771
This is the old post
#Thanks to Maruno for help
The full script is here: http://www.pokecommunity.com/showthread.php?t=299771
This is the old post
Spoiler:
Okay so I'm working on adding a simple bank script for players to store extra money.
My problem is that I can't get the game to recognize my variable.
I can deposit money, but it does not add to the bank ($game_variables[014])
and I cannot withdraw, as I always get the "IF" statement since it does not update.
Can anyone help me with my script?
My problem is that I can't get the game to recognize my variable.
I can deposit money, but it does not add to the bank ($game_variables[014])
and I cannot withdraw, as I always get the "IF" statement since it does not update.
Can anyone help me with my script?
Code:
#This script is for storing the players money in a bank.
def pbDepositBank
if $Trainer.money<MINDEPOSIT
Kernel.pbMessage(
_INTL("Sorry you must have at least ${1} to deposit.",MINDEPOSIT))
else $Trainer.money>=MINDEPOSIT
params=ChooseNumberParams.new
params.setMaxDigits(6)
params.setRange(MINDEPOSIT,$Trainer.money)
params.setCancelValue(0)
qty=Kernel.pbMessageChooseNumber(
_INTL("How much would you like to deposit?"),params)
$game_variables[014]=$game_variables[014]+qty
$Trainer.money=$Trainer.money-qty
end
end
def pbWithdrawBank
if $game_variables[014]==0
Kernel.pbMessage(
_INTL("You do not have any money to withdraw"))
else $game_variables[014]>=1
params=ChooseNumberParams.new
params.setMaxDigits(6)
params.setRange(1,$game_variables[014])
params.setCancelValue(0)
qty=Kernel.pbMessage(
_INTL("How much would you like to withdraw?"),params)
$game_variables[014]=$game_variables[014]-qty
$Trainer.money=$Trainer.money+qty
end
end
Last edited: