Create a free account to remove all ad content.

Author Topic:  ATM  (Read 562 times)

0 Members and 1 Guest are viewing this topic.

Cc NiGhTMaRe cC

  • Member
  • *
  • Posts: 112
  • If YOu See ME join
    • View Profile
  • Xbox: U gOt tRIXed
ATM
« on: January 24, 2015, 11:58:50 AM »
How do you make a ATM. Like we're you put in money and take out money

Zoidberg

  • Legendary Member
  • *
  • Posts: 1445
    • View Profile
  • Xbox: v Zoidberg v
  • Steam: v_Zoidberg_v
Re: ATM
« Reply #1 on: January 24, 2015, 12:05:47 PM »
Script Name: Deposit 500


If
HasInventory [player] [GoldPieces] [>=] [500]
Then
Inventory [player] [take] [GoldPieces] [500]
History [500GP] [player]
Notify [Transaction Successful.] [local]
Else
Notify [Insufficient Funds.]



Script Name: Withdraw 500


If
HasHistory [500GP] [player] [>=] [1]
Then
Inventory [player] [add] [GoldPieces] [500]
History [500GP] [decrease] [player]
Notify [Transaction Successful.] [local]
Else
Notify [Insufficient Funds.] [local]



This method can be expanded to have larger dividends of 500 that also work with the prior Withdrawals and Deposits.

Example:

Script Name: Withdraw 1000


If
HasHistory [500GP] [player] [>=] [2]
Then
Inventory [player] [add] [GoldPieces] [1000]
History [500GP] [decrease] [player]
History [500GP] [decrease] [player]
Notify [Transaction Successful.] [local]
Else
Notify [Insufficient Funds.] [local]


The above examples will allow you to make two deposits of 500, and either withdraw it in two transactions of 500, or one of 1000.

As you can see, the larger dividends have minimal differences, so it is fairly simple to expand, and once you have the base dividend, takes very little time and effort.
« Last Edit: January 24, 2015, 12:13:12 PM by Zoidberg »


Cc NiGhTMaRe cC

  • Member
  • *
  • Posts: 112
  • If YOu See ME join
    • View Profile
  • Xbox: U gOt tRIXed
Re: ATM
« Reply #2 on: January 24, 2015, 12:12:28 PM »
Thanks