I need help with this function
THE RESULT SHOULD BE LIKE:
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}
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