Paste #18933: Untitled Paste

Date: 2015/08/02 22:04:35 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Load Player Cards:
  type: world
  events:
    on player joins:
      - run "s@Load_YAML" "def:/saves/cards/|<player.uuid>cards"
    on player quit:
      - run "s@Unload_YAML" "def:/saves/cards/|<player.uuid>cards"

Cards Command:
  type: command
  name: card
  aliases:
    - cards
    - char
    - chars
    - charcard
    - charcards
    - cc
    - ccs
  usage: /card
  description: Manage your character cards
  permission: command.charactercard
  permission message: "<&c>Upgrade to <&a>Premium <&c>for this feature!"
  script:
    - if <context.server> {
      - narrate "<&c>This is a player only command!"
      - queue clear
    }
    - define Cmd <context.args.get[1]||list>
    - if <el@list.starts_with[<def[Cmd]>]> {
      - define Cards <yaml[<player.uuid>cards].list_keys[]>
      - if <def[Cards].is_empty> {
        - narrate "<&c>You have no character cards!"
        - queue clear
      }
      - narrate "<&2>Your character cards are: <&b><def[Cards].separated_by[<&f>, <&b>]><&2>."
    }