Help with hologram info (using skript-reflect)!

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Francesco

New Member
Dec 6, 2022
7
0
1
I need help with this function

Code:
function getHologramInfo(name: text) :: text:
    # Ottiene l'ologramma
    set {_holo} to DHAPI.getHologram({_name})
    if {_holo} is not set:
        return "&c✗ Ologramma non trovato!"
    
    # Ottiene i dati di posizione
    set {_world} to {_holo}.getLocation().getWorld().getName()
    set {_x} to {_holo}.getLocation().getX()
    set {_y} to {_holo}.getLocation().getY()
    set {_z} to {_holo}.getLocation().getZ()
    set {_size} to {_holo}.getLines().size()
    
    # Prepara le informazioni
    set {_info} to "&6=== Informazioni su %{_name}% ===&r%nl%"
    set {_info} to "%{_info}%&7Posizione: %{_world}%, %{_x}%, %{_y}%, %{_z}%%nl%"
    set {_info} to "%{_info}%&7Linee totali: %{_size}%%nl%"
    
    # Aggiunge le linee (usa un indice manuale)
    set {_i} to 0
    while {_i} < {_size}:
        set {_line} to {_holo}.getLines().get({_i}).getText()
        set {_info} to "%{_info}%&7Linea %{_i}%: &r%{_line}%%nl%"
        add 1 to {_i}
    
    return {_info}

Screenshot 2025-04-27 200801.png


THE RESULT SHOULD BE LIKE:
=== Informazioni su test === - (test is the hologram's name)
Posizione: world, 100.5, 64.0, 200.75 - (position)
Linee totali: 2 - (total lines)
Linea 0: Benvenuto nel server! - (line 0 etc.)
Linea 1: Visita il nostro sito web