Paste #5137: Script re-paste from http://hastebin.com/qaxajulowa.pl

Date: 2014/06/06 22:50:29 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


"Keys":
  type: world
  events:
    on player right clicks with i@Iron Key:
    - if <global.flag[switchable.<player.location.cursor_on>]> queue clear
    - if <player.location.cursor_on.below.material> == m@iron_block {
      - flag global switchable.<player.location.cursor_on> duration:19t
      - switch <player.location.cursor_on> state:on
      - run switchbackoff def:<player.location.cursor_on> delay:2s
      - take "i@Iron Key"
      }
    on player right clicks with i@Gold Key:
    - if <player.location.cursor_on.below.material> == m@gold_block {
      - switch <player.location.cursor_on> state:on
      - run switchbackoff def:<player.location.cursor_on> delay:20s
      - take "i@Iron Key"
      }
    on player right clicks with i@Dime Key:
    - if <player.location.cursor_on.below.material> == m@diamond_block {
      - switch <player.location.cursor_on> state:on
      - run switchbackoff def:<player.location.cursor_on> delay:20s
      - take "i@Dime Key"
      }
"switchbackoff":
  type: task
  script:
  - if <%1%.below.material> == m@iron_block {
    switch <%1%> state:on
    }
  - if <%1%.below.material> == m@gold_block {
    switch <%1%> state:on
    }
  - if <%1%.below.material> == m@diamond_block {
    switch <%1%> state:on
    }

"Iron Key":
   type: item
   material: 265
   display name: "Iron Key"
   lore:
   - Diamond Key, one time use.

"Gold Key":
   type: item
   material: 266
   display name: "Gold Key"
   lore:
   - Diamond Key, one time use.

"Dime Key":
   type: item
   material: 264
   display name: "Diamond Key"
   lore:
   - Diamond Key, one time use.