Paste #2300: Untitled Paste

Date: 2014/02/24 14:27:14 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#An emerald that if held in your inventory will give you a speed boost on sprint.
"speedgem":
  type: item
  material: emerald
  display name: Gem of Speed
  lore:
  - This Gem will enhance your ability
  - to Sprint beyond that of a mortal.

"speedgemscript":
  type: world
  events:
    on player starts sprinting:
    - ^if <player.inventory.contains[speedgem].qty[4]> {
      - cast speed d:120 p:3 
      }
      else {
      - if <player.inventory.contains[speedgem].qty[3]> cast speed d:120 p:2
      else {
      - if <player.inventory.contains[speedgem].qty[2]> cast speed d:120 p:1
      else {
      - if <player.inventory.contains[speedgem].qty[1]> cast speed d:120 p:0
      }
    on player stops sprinting:
    - ^if <player.inventory.contains[speedgem]> {
      - ^cast speed remove <player>
      }