I have tried to think how I would make a leaderboard, but I cant get my head round how. I made a points system, it works fine and fully. But how would I make a leaderboard with the command /points leaderboard.
Here's my current points file code (I haven't started the leaderboard yet as I couldn't figure out how and mess up the code).
Here's my current points file code (I haven't started the leaderboard yet as I couldn't figure out how and mess up the code).
Code:
options:
prefix: &8[&eAnimeme&8]
variables:
{points.%player%} = 0
command /points [<text>] [<offline player>] [<text>]:
trigger:
if player has permission "animeme.pointsadmin":
if arg-1 is set:
if arg-1 is "give":
if arg-2 is set:
if arg-2 has played before:
if arg-3 is set:
if (arg-3 parsed as num) is set:
set {_amount} to arg-3 parsed as a number
add {_amount} to {points.%arg-2%}
send message "{@prefix} &7Successfully added &c%arg-3% &7to &6%arg-2%&7's &7points!"
else:
send message "{@prefix} &cInvalid argument! You must specify a valid number to give."
if arg-3 is not set:
send message "{@prefix} &cInvalid argument! Usage: &7/points give (player) (amount)"
if arg-2 has not played before:
send message "{@prefix} &cPlayer has not played before!"
if arg-2 is not set:
send message "{@prefix} &cInvalid argument! Usage: &7/points give (player) (amount)"
else if arg-1 is "clear":
if arg-2 is set:
if arg-2 has played before:
set {points.%arg-2%} to 0
send message "{@prefix} &6%arg-2%&7's points have been cleared!"
if arg-2 has not played before:
send message "{@prefix} &cPlayer has not played before!"
if arg-2 is not set:
send message "{@prefix} &cInvalid argument! Usage: &7/points clear (player) "
else if arg-1 is "remove":
if arg-2 is set:
if arg-2 has played before:
if arg-3 is set:
if (arg-3 parsed as num) is set:
set {_amount} to arg-3 parsed as a number
if {_amount} is smaller than or equal to {points.%arg-2%}:
if {points.%arg-2%} is equal to 0:
send message "{@prefix} &cThis player has no points to be removed!"
else:
subtract {_amount} from {points.%arg-2%}
send message "{@prefix} &7Successfully took &c%arg-3% &7points from &6%arg-2%&7!"
else:
send message "{@prefix} &cThat number is bigger than the player's amount of points!"
else:
send message "{@prefix} &cInvalid argument! You must specify a valid number to remove."
if arg-3 is not set:
send message "{@prefix} &cInvalid argument! Usage: &7/points give (player) (amount)"
if arg-2 has not played before:
send message "{@prefix} &cPlayer has not played before!"
if arg-2 is not set:
send message "{@prefix} &cInvalid argument! Usage: &7/points give (player) (amount)"
else if arg-1 is "set":
if arg-2 is set:
if arg-2 has played before:
if arg-3 is set:
if (arg-3 parsed as num) is set:
set {points.%arg-2%} to arg-3 parsed as a number
if {points.%arg-2%} is equal to 1:
send message "{@prefix} &7Successfully set &6%arg-2%&7's points to &a%arg-3% &apoint&7!"
else:
send message "{@prefix} &7Successfully set &6%arg-2%&7's points to &a%arg-3% &apoints&7!"
else:
send message "{@prefix} &cInvalid argument! You must specify a valid number to set."
if arg-3 is not set:
send message "{@prefix} &cInvalid argument! Usage: &7/points give (player) (amount)"
if arg-2 has not played before:
send message "{@prefix} &cPlayer has not played before!"
if arg-2 is not set:
send message "{@prefix} &cInvalid argument! Usage: &7/points give (player) (amount)"
else:
send message "{@prefix} &cInvalid argument! Usage: &7/points (give/clear/remove/set) (player) (amount)"
if arg-1 is not set:
send message "{@prefix} &7You have &a%{points.%player%}% &apoints&7."
if player does not have permission "animeme.pointsadmin":
send message "{@prefix} &7You have &a%{points.%player%}% &apoints&7."