Solved Sidebar not showing the player with the same value

  • 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 community!

    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!

EvoTrickered

New Member
Jul 10, 2024
5
0
1
Code:
every 1 second:
    loop all players:
        wipe loop-player's sidebar
        set name of sidebar of loop-player to "&eTop Levels"
        set {_sortedList::*} to sorted {perma.level::*}
        # set {_sortedList::*} to reversed {_sortedList::*}
        loop {perma.level::*}:
            add 1 to {_count}
            set {_indexes::%loop-value-2%} to loop-index
        if mod({_count}, 20) = 0:
            wait 1 tick
        set {_line} to 1
        loop {_sortedList::*}:
            if {_line} > 10:
                stop
            set {_current} to {_indexes::%loop-value-2%} parsed as offline player's name
            set score "&e%{_current}% - &b%loop-value-2%" in sidebar of loop-player to {_line}
            add 1 to {_line}
The problem is if 2 players have Level 5 in Sidebar it show
Player - 5
instead of
Player1 - 5
Player2 - 5
Addon: SkRayFall, SkBee, MorkazSk
 
Code:
every 1 second:
    set {_line} to 1
    loop all players:
        set title of loop-player's scoreboard to "&bTop Levels"
        set {_sortedList::*} to sorted {perma.level::*} from highest to lowest with output "@index @value"
        loop {_sortedList::*}:
            if {_line} is 11:
                set {_line} to 1
            set {_split::*} to split loop-value-2 at " "
            set {_split::1} to {_split::1} parsed as offline player
            set line {_line} of loop-player's scoreboard to "&e%{_split::1}% &b%{_split::2}%"
            add 1 to {_line}
I fixed it