HyperScript
Docs

← All of the Docs Players

Top lists

expressiontop <n> players by {<name>}since 1.5.8

A list of up to n player names, best first

set {_place} to 0
for each {_name} in top 10 players by {coins}:
    add 1 to {_place}
    send "&e#%{_place}% &f%{_name}%"
Try it
expressionrank of <who> by {<name>}since 1.5.8

Where that player stands, 1 being the best; unset if they have no value

set {_mine} to rank of player by {coins}
send "&7You are #%{_mine}%"
Try it
Guide and examples

top orders every player who has ever played by one of their own variables, highest first, whether they are online or not:

command /baltop:
    trigger:
        send "&6Richest players"
        set {_place} to 0
        for each {_name} in top 10 players by {coins}:
            add 1 to {_place}
            send "&e#%{_place}% &f%{_name}% &7- %{%{_name}%.coins}% coins"
        set {_mine} to rank of player by {coins}
        send "&7You are #%{_mine}%"
SyntaxResult
top <n> players by {<name>}A list of up to n player names, best first
rank of <who> by {<name>}Where that player stands, 1 being the best; unset if they have no value
  • The variable is each player's own: {coins} here means the same as {%player%.coins}, and both spellings are accepted.
  • Only players who have a number in that variable are listed.
  • The first time a list is asked for after a restart, HyperScript reads every player's data to build it, which on a large server with a database can take a moment. After that it is kept up to date as values change and costs almost nothing.