Author Topic: [Scripts] Advanced bank script?  (Read 93 times)

0 Members and 1 Guest are viewing this topic.

SmileYourOnAim

  • Jr. Member
  • **
  • Posts: 45
    • View Profile
    • Awards
[Scripts] Advanced bank script?
« 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.

MEDUSA

  • Supreme Member
  • *****
  • Posts: 2973
  • - Jaz
  • Awards Awarded to exemplary forum members 3 years on site+600 posts Was in the top 10 of the forum stats page as of 4/12/15 Former MotM winners 4 years on site+1000 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts 1 year on site+100 posts
    • View Profile
    • cluckinbellhappychicken
    • Awards
  • Xbox: Jaz the MAN 2
  • PSN: Jaz_the_MAN_2
  • Steam: Jaz the MAN 2
Re: Advanced bank script?
« Reply #1 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



I had to break up with Medusa. I just got sick of buying mice for her hair.
I should have ended it sooner, but you try looking into those eyes.


SmileYourOnAim

  • Jr. Member
  • **
  • Posts: 45
    • View Profile
    • Awards
Re: Advanced bank script?
« Reply #2 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.

Dryym

  • Supreme Member
  • *****
  • Posts: 4306
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
Re: Advanced bank script?
« Reply #3 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]

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym