Paste #45178: Quick thing for AncientTom

Date: 2017/10/24 12:52:51 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


BankTellerScript:
  type: assignment
  debug: true
  actions:
    on assignment:
    - trigger name:proximity state:true radius:2
    - trigger name:chat state:true radius:2
  interact scripts:
  - 1 BankTellerInteract

BankTellerInteract:
  type: interact
  steps:
    1:
      proximity trigger:
        entry:
          script:
          - chat "<yellow>Hello <player.name>, would you like to <gold>deposit <yellow>or <gold>withdraw <yellow>money?<&nl><gray>Hint: Type in the gold words to choose that option!"
        exit:
          script:
          - chat "<yellow>Y'all have a good day now."
      chat trigger:
        1:
          trigger: /deposit/
          script:
          - chat "<yellow>How much would you like to deposit?"
          - zap 2
        2:
          trigger: /withdraw/
          script:
          - chat "<yellow>How much would you like to withdraw?"
          - zap 3
    2:
      proximity trigger:
        exit:
          script:
          - chat "<yellow>Oh, you changed your mind? Have a nice day, then!"
          - zap 1
      chat trigger:
        1:
          trigger: /regex:\d+/
          script:
          #### Test to see if the player has enough money, then do what you need here
          - zap 1
        2:
          trigger: /regex:.+/
          script:
          - chat "<yellow>I'm afraid that isn't a valid amount. So would you like to <gold>deposit <yellow>or <gold>withdraw <yellow>money?"
          - zap 1
    3:
      proximity trigger:
        exit:
          script:
          - chat "<yellow>Oh, you changed your mind? Have a nice day, then!"
          - zap 1
      chat trigger:
        1:
          trigger: /regex:\d+/
          script:
          #### Test to see if the player has enough money, then do what you need here
          - zap 1
        2:
          trigger: /regex:.+/
          script:
          - chat "<yellow>I'm afraid that isn't a valid amount. So would you like to <gold>deposit <yellow>or <gold>withdraw <yellow>money?"
          - zap 1