Sorted list

  • 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.
Jul 16, 2020
30
2
8
18
I am wondering how I can make a sorted list with like from highest to lowest. I am making a custom rank system and making /grant gui and I want it to be sorted via the priority value. How can I do that?
 
Code:
function sort(indices: strings, values: numbers, descending: boolean = true) :: strings:
    loop {_indices::*}:
        set {_sort::%{_values::%loop-index%}%.%loop-index%} to loop-value
    return (reversed {_sort::*}) if {_descending} is true, else {_sort::*}
 
Status
Not open for further replies.