Paste #30842: Untitled Paste

Date: 2016/02/27 05:36:18 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


CoinFlip:
  type: command
  name: Coinflip
  usage: /coinflip [player] [amount]
  description: Flip a coin and bet your money on the outcome!
  tab complete:
  - determine <server.list_players.parse[name].filter[starts_with[<context.args.last||>]]>
  script:
    - define CoinFlipMoney <context.args.get[2]>
    - define CoinFlipEnemy <context.args.get[1]>
    - if <player.money> < <def[CoinFlipMoney]> {
      - if <def[CoinFlipEnemy]> < <def[CoinFlipMoney]> {
        - narrate "<&c>You dont have enough money to flip the coin!"
        - queue clear 
      }
    }
  - narrate "<&6>Sent Coinflip request to <&f><def[CoinFlipEnemy]> <&6>for $<def[CoinFlipMoney]>!"
  - narrate "<&a>They have 15 seconds to accept the coin flip by doing /coinflip accept"
  - narrate "<&6>Player <player.name> wants to flip-a-coin with you for $<def[CoinFlipMoney]>" targets:<def[CoinFlipEnemy]>
  - narrate "<&7>Type /coinflip accept to accept the coinflip!" targets:<def[CoinFlipEnemy]>
  - flag <player> CoinFlip duration:15s
  - flag <def[CoinFlipEnemy]> CoinFlip duration:15s





CoinFlipAccept:
  type: command
  name: CoinflipAccept
  usage: /coinflip accept
  description: Accept the coin flip request
  script:
  - if <player.has_flag[CoinFlip]> {
    - narrate "<&6>Coin flip accepted! Flipping the coin in..."
    - wait 1s
    - narrate "<&7>3..."
    - wait 1s
    - narrate "<&7>2..."
    - wait 1s
    - narrate "<&7>1..."
    - wait 1s
  }


# WHAT
# The
# FUCK
# AM
# I
# DOING
# LOL?