Total Miner Forums

Total Miner => Creative Features => Topic started by: SmileYourOnAim on December 26, 2017, 06:47:16 PM

Title: Advanced bank script?
Post by: SmileYourOnAim on December 26, 2017, 06:47:16 PM
Does anyone know how to make a script in which a players bank(s) can be accessed from different areas around the map, but only have their chest (Or even better, them not having a chest) in one area.
Title: Re: Advanced bank script?
Post by: Jaz on December 26, 2017, 06:50:08 PM
This should be what you are looking for...
This will allow players to deposit gold pieces only.
Quote
Script name:Deposit

Input [Amount]
If
HasInventory [player] [gold pieces] [>=] [Amount]
then
History [Bank Balance] [player] [+Amount]
Inventory [Player] [take] [gold pieces] [Amount]
Notify [ [Amount] gold pieces deposited] [Local]
Else
Notify [You dont have enough gold pieces to make this deposit] [local]
Endif

--------
Script:Withdraw

Input [Amount]
If
HasHistory [Bank Balance] [player] [>=] [Amount]
Then
History [Bank Balance] [player] [-Amount]
Inventory [player] [add] [gold pieces] [Amount]
Notify [ [Amount] Gold pieces withrawn] [local]
else
notify [You dont have enough gold pieces in your account to make this withdrawal] [local]
Endif
Title: Re: Advanced bank script?
Post by: SmileYourOnAim on December 26, 2017, 06:54:55 PM
I know how to make a script which only deposits/withdraws gold pieces, but i'm looking for a script which a players chest(s) can be opened around the map.
Title: Re: Advanced bank script?
Post by: Dryym on December 26, 2017, 09:25:31 PM
If you only want one chest to be accessible from anywhere, You could have a remote access item with this as the swing event.

If
  IsBlock [crel:0,0,0] [chest]
Then
  Var [x] = [crel:x]
  Var [y] = [crel:y]
  Var [z] = [crel:z]
  History [Chest\x] [player] [x]
  History [Chest\y] [player] [y]
  History [Chest\z] [player] [z]
ElseIf
  IsBlock [crel:0,0,0] [lockedchest]
Then
  Var [x] = [crel:x]
  Var [y] = [crel:y]
  Var [z] = [crel:z]
  History [Chest\x] [player] [x]
  History [Chest\y] [player] [y]
  History [Chest\z] [player] [z]
Else
  Var [x] = [history:Chest\x]
  Var [y] = [history:Chest\y]
  Var [z] = [history:Chest\z]
  OpenBlock [x,y,z]