Jump to content

Skript gui leaderboard


Birdy_Bot

Recommended Posts

I want something like a 6 row gui that shows like example killstop would show at top of gui the player with top kills & the gui item of that slot would be the player's head & so on it's something everyone would love but every one i find has like 7 addons needed i got skbee & skrayfall if that helps

Link to comment
Share on other sites

  • 3 weeks later...

Hi, you can actually do this with just skript, by using vanilla guis and a smart sorting function.
Let's assume your kills variable is {kills::%player's uuid%}


function sorted(list: numbers, indices: strings) :: strings:
    loop {_indices::*}:
        set {_sorted::%{_list::%loop-index%}%.%loop-index%} to loop-value
    return (reversed {_sorted::*})

command /killstop:
    trigger:
        set metadata tag "killstop" of player to chest inventory with 3 rows named "&eTop Kills"
        set {_sorted::*} to sorted({kills::*}, indices of {kills::*})
        loop 9 times:
            set {_uuid} to {_sorted::%loop-number%}
            set {_player} to {_uuid} parsed as offlineplayer
            set {_kills} to {kills::%{_uuid}%}
            set slot (8 + loop-number) of metadata tag "killstop" of player to {_player}'s skull named "&e&l##%loop-number% &a%{_player}% &7- &e%{_kills}% kills"
        open metadata tag "killstop" of player to player

This is what it would look like
image.png.4453c1f01d434ae685e80d1037495982.png

2 minutes ago, 100_ said:

Hi, you can actually do this with just skript, by using vanilla guis and a smart sorting function.
Let's assume your kills variable is {kills::%player's uuid%}


function sorted(list: numbers, indices: strings) :: strings:
    loop {_indices::*}:
        set {_sorted::%{_list::%loop-index%}%.%loop-index%} to loop-value
    return (reversed {_sorted::*})

command /killstop:
    trigger:
        set metadata tag "killstop" of player to chest inventory with 3 rows named "&eTop Kills"
        set {_sorted::*} to sorted({kills::*}, indices of {kills::*})
        loop 9 times:
            set {_uuid} to {_sorted::%loop-number%}
            set {_player} to {_uuid} parsed as offlineplayer
            set {_kills} to {kills::%{_uuid}%}
            set slot (8 + loop-number) of metadata tag "killstop" of player to {_player}'s skull named "&e&l##%loop-number% &a%{_player}% &7- &e%{_kills}% kills"
        open metadata tag "killstop" of player to player

This is what it would look like
image.png.4453c1f01d434ae685e80d1037495982.png

You can change the code as you wish to make it however many rows and players you want to show. Just increase the number of times you're looping (e.g do loop 20 times instead of 9). If you want to organise the heads in a specific pattern you could make a list which has a list of slots were you want each head to go and then place the head there, instead of just basing it off loop-number.

Edited by 100_
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...