Paste #38893: Inspecting

Date: 2017/01/10 13:40:38 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Inspect:
  type: command 
  name: Inspect
  usage: /Inspect (player) 
  description: Check another player's armor.
  script: 
  - if <context.server> && <context.args.size> == 0 { 
    - narrate "<&c>You must enter a player from console!" 
    - queue clear 
  } 
  - if <context.server.not> { 
    - define Target <player> 
  } 
  - if <context.args.size> >= 1 { 
    - define Target <server.match_offline_player[<context.args.get[1]>]||null> 
    - if <def[Target]> == null { 
      - narrate "<&c>No player can be found by that name!" 
      - queue clear 
    } 
  } 
  else {
  - inventory open d:in@Inspect_Menu 
  }

Inspect_Menu:
  type: Inventory
  title: <&6><&l>Inspecting
  size: 9
  definitions:
    Boots: i@<def[Target].equipment.boots>
  slots:
  - "[Boots] [] [] [] [] [] [] [] []"

InspectHandler:
  type: world
  events:
    on player clicks in Inspect_Menu:
    - determine cancelled
    on player drags in Inspect_Menu:
    - determine cancelled