Hologram Maker

Share scripts you wrote for Denizen-Bukkit here!
Post Reply
MadeBySaints
New
New
Posts: 4
Joined: December 16th, 2020, 5:05 pm

Hologram Maker

Post by MadeBySaints » December 18th, 2020, 9:12 am

I bring to you a much improved and updated version of a hologram maker script that I used years and years ago.

Drag and drop into your scripts folder, reload and start creating holograms!

Holograms are created by using /holo [displayname]

NEW:
The old hologram script only had a feature for creating holograms, but not deleting them. This would leave holograms floating all over the server that cant be deleted because they are attached to an invisible entity (armor stand).
I've improved upon this and brought the wonderful /delholo command into the mix!

Holograms are deleted by looking at the holo you want to delete and typing /delholo [displayname]

Note: When deleting holograms, if there are spaces in the name, you will need to use "Quotes" to handle the [displayname] properly. (e.g. /delholo "this hologram has spaces")

You can give players permissions to use the commands too!
Permission nodes provided:
holo.create
holo.delete

Holos are enabled for ops by default.

here's the haste link: https://one.denizenscript.com/haste/78912

and here's the raw script:

Code: Select all

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
          
        
Last edited by MadeBySaints on December 18th, 2020, 7:49 pm, edited 4 times in total.

MadeBySaints
New
New
Posts: 4
Joined: December 16th, 2020, 5:05 pm

UPDATES

Post by MadeBySaints » December 18th, 2020, 10:09 am

(UPDATE)
fixed issue with empty args.
debug: false

(PLANNED)
clean up narrate text
send some messages to actionbar

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 299
Joined: August 5th, 2016, 7:27 pm
Location: Los Angeles, California, USA
Contact:

Re: Hologram Maker

Post by mcmonkey » December 18th, 2020, 3:12 pm

This script is full of errors that would be labeled instantly by the script editor - https://guide.denizenscript.com/
Denizen lead developer. On Discord as mcmonkey#6666.

MadeBySaints
New
New
Posts: 4
Joined: December 16th, 2020, 5:05 pm

Re: Hologram Maker

Post by MadeBySaints » December 18th, 2020, 8:06 pm

mcmonkey wrote:
December 18th, 2020, 3:12 pm
This script is full of errors that would be labeled instantly by the script editor - https://guide.denizenscript.com/
I should have mentioned I used .yml, not realizing there was an official extension for vs code (which i will be getting right away!) and changing this to use .dsc format, thanks so much for the direction master.

That being said, if this is copied and pasted into a .yml file and dropped in the denizen/scripts folder it will work as intended

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest