• Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

senge1337

Member
Sep 21, 2019
37
0
6
22
Hi,
I have a problem.
I have a variable {cookieclicker::%player's uuid%::emoji_stuck_out_tongue:oints}.
How would I make a top GUI list with it?
I mean like:
Code:
open virtual chest inventory with size 6 named "&b&lTOP" to player
format gui slot 0 of player with 1 of skull of ("senge1337" parsed as offlineplayer) named "&61. senge1337" with lore "&63 cookies."
There is code online to do it, but it's just with {cookieclicker::%player%::emoji_stuck_out_tongue:oints} and im using UUID's

Example of that code:
Code:
command /test:
    trigger:
        set {_s} to size of {cookieclicker::*::points}
        loop {cookieclicker::*::points}:
            set {_list::%loop-index%} to loop-value
        loop {_s} times:
            loop {_list::*}:
                if {_v.%loop-number%} is not set:
                    set {_v.%loop-number%} to loop-value-2
                    set {_n.%loop-number%} to loop-index
                if loop-value-2 is larger than {_v.%loop-number%}:
                    set {_v.%loop-number%} to loop-value-2
                    set {_n.%loop-number%} to loop-index
            remove {_v.%loop-number%} from {_list::*}
        loop {_s} times:
            if loop-number is smaller than or equal to 5:
                send "%loop-number%. %{_n.%loop-number%}% -> %{_v.%loop-number%}%"

I know this is not a GUI, but i could change this.

Anyone know how to solve this issue? The code above would probably just give me 1. [MyUuid] instead of 1. senge1337.
Thanks,
senge1337.
 
Better sorting expression, works fine with any number and ignores other types:
Usage: (1¦(highest|top)|2¦(lowest|last)) %integer% values of %objects% (with format|formatted) %string%

https://sourceb.in/94c37bd0ab

Credit to EWS
That code you sent uses TreeSet. TreeSet is a bad idea because it doesn't allow duplicates. If two players have the same value, only one will be counted. This is pretty bad for a leaderboard.
 
Status
Not open for further replies.