Tab sorting

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

Status
Not open for further replies.

Mattllama987

Supporter
Aug 5, 2018
225
7
18
Hello, i have a prison server with a custom tab i made with skript. I need to know how i can sort the tab to be the high staff to lowest. Then the donors. Then the normal players. Ive seen lots of posts with people wanting to know the same thing. But they were never answered.

Thanks!
 
Credits to: @ShaneBee will need skript-mirror
code_language.skript:
on load:
    delete {ranks::*}
    delete {prefixes::*}
    set {ranks::owner} to "A-OWNER"
    set {ranks::admin} to "B-ADMIN"
    set {ranks::player} to "C-PLAYER"
  
function updateTab(p: player):
    loop {ranks::*}:
        {_p}.getScoreboard().registerNewTeam(loop-value)
        player.getScoreboard().getTeam(loop-value).setPrefix({prefixes::%loop-index%})
    if {_p} has permission "ng.owner":
        set {rank::sorting::%{_p}%} to "A-OWNER"
      
    else if {_p} has permission "ng.admin":
        set {rank::sorting::%{_p}%} to "B-ADMIN"
      
    else:
        set {rank::sorting::%{_p}%} to "C-PLAYER"
      
    {_p}.getScoreboard().getTeam({rank::sorting::%{_p}%}).addPlayer(player)
    loop players:
        loop-player.getScoreboard().getTeam({rank::sorting::%{_p}%}).addPlayer({_p})
        {_p}.getScoreboard().getTeam({rank::sorting::%loop-player%}).addPlayer(loop-player)
      
      
on join:
    updateTab(player)
 
Credits to: @ShaneBee will need skript-mirror
code_language.skript:
on load:
    delete {ranks::*}
    delete {prefixes::*}
    set {ranks::owner} to "A-OWNER"
    set {ranks::admin} to "B-ADMIN"
    set {ranks::player} to "C-PLAYER"
 
function updateTab(p: player):
    loop {ranks::*}:
        {_p}.getScoreboard().registerNewTeam(loop-value)
        player.getScoreboard().getTeam(loop-value).setPrefix({prefixes::%loop-index%})
    if {_p} has permission "ng.owner":
        set {rank::sorting::%{_p}%} to "A-OWNER"
     
    else if {_p} has permission "ng.admin":
        set {rank::sorting::%{_p}%} to "B-ADMIN"
     
    else:
        set {rank::sorting::%{_p}%} to "C-PLAYER"
     
    {_p}.getScoreboard().getTeam({rank::sorting::%{_p}%}).addPlayer(player)
    loop players:
        loop-player.getScoreboard().getTeam({rank::sorting::%{_p}%}).addPlayer({_p})
        {_p}.getScoreboard().getTeam({rank::sorting::%loop-player%}).addPlayer(loop-player)
     
     
on join:
    updateTab(player)
I already sent him the link on discord, but thank you :emoji_heart_eyes::emoji_heart_eyes::emoji_heart_eyes:
 
Have a wonderful day! <3
HOW DARE YOU TELL ME WHAT TO DO...
I'm going to have a wonderful day whether you tell me to or not... you don't ownnnn me!

NO, YOU HAVE A WONDERFUL DAY!!!

(I really hope people can sense the sarcasm here... I :emoji_heart: Matt)
 
HOW DARE YOU TELL ME WHAT TO DO...
I'm going to have a wonderful day whether you tell me to or not... you don't ownnnn me!

NO, YOU HAVE A WONDERFUL DAY!!!

(I really hope people can sense the sarcasm here... I :emoji_heart: Matt)
HOW DARE YOU TO TELL ME WHAT TO SENSE..

IM GOING TO MISINTERPRETATE THAT AND REPORT YOU BECAUSE YOURE A NICE PERSON- Wait that doesn’t make sense
 
HOW DARE YOU TO TELL ME WHAT TO SENSE..

IM GOING TO MISINTERPRETATE THAT AND REPORT YOU BECAUSE YOURE A NICE PERSON- Wait that doesn’t make sense
HOW DARE YOU REPORT MY "NICENESS" .... HOW DARRRREEEE YOU!
 
Status
Not open for further replies.