Paste #78912: Edit of P#78911 - Edit of P#78910 - Hologram Maker

Date: 2020/12/18 14:16:49 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Create_Holo:
  type: command
  debug: false
  name: holo
  usage: /holo
  aliases:
    - hc
  description: Will make holograms
  permission: holo.create
  script:
    - if !<player.has_permission[<context.permission>] && !<player.is_op>:
      - narrate "<&3><&l>You are missing a permission! <&r><&2><context.permission>" target:<player>
      - stop
    - if <context.args.size> == 0:
      - narrate "<&3><&l>You need to define a name for the hologram <&r><&3>(example- <&r><&2>/holo myholo<&3><&l>)"
      - stop
    - else:
      - define title <context.raw_args.parse_color>
      - spawn armor_stand <player.location> save:stand
      - adjust <entry[stand].spawned_entity> visible:false
      - adjust <entry[stand].spawned_entity> custom_name:<[title]>
      - adjust <entry[stand].spawned_entity> custom_name_visible:true
      - actionbar "<&3><&l>Hologram created with name <&2><def[title]><&3>."
Delete_Holo:
  type: command
  debug: false
  name: delholo
  usage: /delholo
  aliases:
    - dh
  description: Will remove holograms
  permission: holo.delete
  script:
    - if <context.args.size> == 0:
      - narrate "<&3><&l>You need to define a name for the hologram <&r><&3>(example- <&r><&2>/dh myholo<&3>)"
      - stop
    - else:
      - define targholo "<context.args.get[1]>"
      - if <player.has_permission[<context.permission>] || <player.is_op>:
        - if <player.target.custom_name> == <def[targholo]>:
          - remove <player.target>
          - actionbar "<&3><&l>Hologram removed" target:<player>
        - else:
          - narrate "<&3><&l>Target custom name mismatch" target:<player>
          - stop
      - else:
        - narrate "<&3><&l>You are missing a permission! <&r><&2><context.permission>" target:<player>
        - stop