#Gui Leaderboards
1 messages · Page 1 of 1 (latest)
well i dont event know where to begin making it
well, you'd need your stats, to start
are you tracking whatever this leaderboard stat is (kills, balance, etc)?
{test::%uuid of player%}
doesnt matter ill jsut set the variable later
all it is it has to be top 10 gui leaderboard
okay, so then you'd likely want to make a list of this variable thats sorted
x8ight suggests that you read this embed
The sorted indices expression returns a new list of indices sorted by the value of the index. This can be very helpful for making all sorts of leaderboards. Lets say we have the balances of our players saved in the variable {balance::%player's uuid%}. To create our leaderboard we can use```vb
set {_sorted::} to sorted indices of {balance::} in descending order````{_sorted::*}will be a list of uuids with{_sorted::1}being the person with the most money. If we wanted to check how much money they had we could plug the uuid back into the original variable:{balance::%{_sorted::1}%}`
command /baltop:
trigger:
set {_sorted::*} to sorted indices of {balance::*} in descending order
send "<aqua>Baltop"
loop first 10 elements of {_sorted::*}:
send "<gold>%loop-iteration%. <white>%offlineplayer(loop-value)% <gray>- <green>$%{balance::%loop-value%}%"```
hmm
so thats like not as gui
so i understand how that owrk
bc thats like more easie
bc you cna like send the message but in gui you have to loop all at once
and set
theres error here
loop first 10 elements of {_sorted::*}:
it cant understand
can I see the code
command /baltop:
trigger:
set {_sorted::} to sorted indices of {balance::} in descending order
send "<aqua>Baltop"
loop first 10 elements out of {_sorted::*}:
send "<gold>%loop-iteration%. <white>%offlineplayer(loop-value)% <gray>- <green>$%{balance::%loop-value%}%"