#Baltop Skript

1 messages · Page 1 of 1 (latest)

modest perch
#

How do I grab the balance and head of each player then format it to highest balance to lowest balance?

#

Im using skript's built in gui system.

nocturne belfry
modest perch
#

wont let me paste skript?

modest perch
nocturne belfry
#

Its annoying 😭

modest perch
#

theey keep blocking the actual text 😭

nocturne belfry
#

Are you using ai?

modest perch
#

the loop was just a placeholder for the slots

modest perch
#

the refresh thing yes

#

cause I thought you had to do some complex closing and reopening system

modest perch
#

so anyone got a idea on how to do it?

nocturne belfry
robust snow
#

Sorted Indices
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
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}%}
Leaderboard Example

    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%}%"```

Send any suggestions to
#

^ can't use skunitys helper here so just copy pasted

#

from there it isn't hard to get the head

modest perch
#

alright ty

#

can you send me the link to the source though?

#

if not here send me a dm of it

robust snow
#

you mean the original message by the bot?

modest perch
#

any idea on how to get the head of the players??

pallid ocean
# modest perch any idea on how to get the head of the players??

What is that?
You are looping all offline players, and {_target} is never being set? You need the variable {_list::%uuid of loop-player%} to be the player’s balance, and then {_top::%loop-number%} will be the uuid of the player and you can use the uuid to parse it as a offline player and get the balance