Paste #33878: Untitled Paste

Date: 2016/05/30 13:04:29 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


KillCounter:
  type: world
  debug: false
  events:
    on player clicks in inventory: 
    - narrate "<c.inventory.title.strip_color.contains_any_text[Kill Counter]>"
    - narrate "<c.inventory.title.strip_color>"
    - if "!<c.inventory.title.strip_color.contains_any_text[Kill Counter]||false>" {
      - queue clear
      } else {
      - narrate <context.item.display_name.strip_color||null>
      # - if <player.flag[KILL_COUNTER_REWARDS].contains_any_text[<context.item.display_name.strip_color>]||false> {
      - foreach <player.flag[KILL_COUNTER_REWARDS].as_list.filter[contains_any_text[<context.item.display_name.strip_color>]]>:
        - flag player KILL_COUNTER_REWARDS:<-:<def[value]>
        - narrate "DELUJJE"
      - determine cancelled passively
      }
    on player closes inventory:
    - if "<c.inventory.title.strip_color.contains_any_text[Kill Counter]||false>" {
      - if <server.list_notables.contains[in@KillCounter_<player.name>]> {
        - note remove as:KillCounter_<player.name>
        }
      }
    on player kills entity:
    - if <c.entity.has_flag[SPAWNER]> {
      - queue clear
      }
    - if <server.flag[MONSTER_LIST].as_list.contains[<c.entity.entity_type>]> && <c.entity.has_flag[spawner].not> {
      - if <yaml[<player.uuid>].read[kills.monsters.<c.entity.entity_type>].as_int.is[==].to[10]> {
        - flag player KILL_COUNTER_REWARDS:->:<c.entity.entity_type>_10
        - title "title:<&a>Kill Counter<&co> <&3><c.entity.entity_type> <&a>milestone reached!" "subtitle:type <yellow> /counter <white>to claim your reward!"
        }
      }