Paste #42748: Untitled Paste

Date: 2017/06/21 00:59:00 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


SelectChatColor:
  type: command
  name: chatcolor
  script:
    - if <context.args.size> == 0 {
      - narrate "<green>You can select a <gold>chat color<green> by using <gold>/chatcolor [color name]<green>."
      - narrate "<green>A list of all the colors to choose from can be found by typing <gold>/colorlist<green>."
      - if <player.has_flag[chatColorFlag]> {
        - narrate "<&o>You can also clear it with <gold><&o>/chatcolor clear<white><&o>, but I don't know why you'd want to do that..."
        }
      - queue clear
      }
    - if <context.args.get[1]> == "clear" {
      - if <player.has_flag[chatColorFlag]> {
        - flag player chatColorFlag:!
        - narrate "<gold>Chat color<green> successfully cleared... <white><&o>But why..?"
        - queue clear
        }
      }
    - define map li@dark_blue/<dark_blue>|blue/<blue>|dark_aqua/<dark_aqua>|aqua/<aqua>|dark_red/<dark_red>|red/<red>|yellow/<yellow>|gold/<gold>|dark_green/<dark_green>|green/<green>|dark_purple/<dark_purple>|light_purple/<light_purple>|white/<white>|gray/<gray>|dark_gray/<dark_gray>|black/<black>
    - if <def[map].map_get[<context.args.get[1]>]||null> {
      - narrate "<gold>Chat color <green>successfully changed!" 
      - flag player chatColorFlag:<li@list.map_get[<context.args.get[1]>]>
      - queue clear
      } 
      else {
      - narrate "<red>Please type the color exactly as shown in <white>/colorlist<red>."
      - queue clear
      }