I'm trying to create a moderator tool that allows me to view a GUI that shows me the heads of all online players, and then if I were to click on a head it would teleport me to that player. I haven't bothered trying to code the click/teleport function, because I am so far unable to get showing the heads to work. I'm still new to Skript and coding in general, but I understand the issue with my code is that with the way I worded it, it's attempting to format each individual slot with every person's head at the same time, and I do not know the right way to say "I want the first online player's head to occupy the first slot, and the next online player's head to occupy the next slot, and so on until all the online player's heads are listed." I've searched everywhere I can think of but I can't find any sort of Skript that resembles that sort of action
code_language.skript:
command /stalk:
description: Opens a GUI that allows a mod to select the player they wish to teleport to
permission: skript.mod
trigger:
open chest with 3 rows named "Victim List" to player
wait 2 ticks
loop integers between 0 and 26:
format slot loop-number of player with skull of all players to be unstealable