So I've only been using Skript for the past 3 days but here is the Skript I'm working on (I know the code is horrible atm). So I'm creating a custom punishment system and when the player types /cerberus it pops up with a GUI with players online. The concept is that it creates a variable list with all online players, then it calls upon each player name in the list, displaying the corresponding heads in slots 9-44 (There will be navigational buttons in the GUI so these are the slots that can contain heads), then stopping at slot 44, and on the next page it resumes. If possible I would like the heads in alphabetical order but idk if it's possible with list variables. I'm pretty close and my skript works (ish).
Code:
#
#
# /punish
#
#
on join:
add player to {Online::*}
add 1 to {Count}
if {Count} = 1:
set {P1} to the first element out of {Online::*}
if {Count} = 2:
set {P2} to random object out of {Online::*}
if {Count} = 3:
set {P3} to the third element out of {Online::*}
if {Count} = 4:
set {P4} to the fourth element out of {Online::*}
if {Count} = 5:
set {P5} to the fifth element out of {Online::*}
on disconnect:
remove player from {Online::*}
remove 1 from {Count}
command /liste:
trigger:
send "%{P1}%"
send "%{P2}%"
send "%{P3}%"
send "%{P4}%"
send "%{P5}%"
command /cerberus:
trigger:
if player does not have the permission "permission.cerberus":
send "&8» &cPermission &8| &7You do not have access to this!"
exit
create a gui with virtual chest with 6 rows named " ":
make gui slot 4 with nether star named "&cSelect A Player To Punish" with lore "&7You will then be prompted to", "&7select a type, reason, and duration" and "&7for the punishment."
if {_Slot} is not set:
set {_Slot} to 43
{_Slot} < 45
make gui slot {_Slot}+1 with {P1}'s skull named "&b%{P1}%" with lore "&7" and "&7Click to punish %{P1}'s name%":
make player execute command "punish %{P1}%"
make gui slot 50 with arrow named "&ePage 2":
create a gui with virtual chest with 6 rows named " ":
set {_Slot} to 8
make gui slot 4 with nether star named "&cSelect A Player To Punish" with lore "&7You will then be prompted to", "&7select a type, reason, and duration" and "&7for the punishment."
make gui slot {_Slot}+1 with {P2}'s skull named "&b%{P2}%" with lore "&7" and "&7Click to punish %{P2}'s name%":
make player execute command "punish %{P2}%"
open last gui to player
open last gui to player
exit