Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Skript publiched on https://minecraft-list.gg
- on load:
- loadTopVotes()
- command /clearvotestop: #Clear the data from the leaderboard.
- permission: *
- trigger:
- delete {votes::topStats::*}
- wait 2 ticks
- loadTopVotes()
- send "You cleared the current leaderboard."
- command /topvotes:
- trigger:
- send "&8[ &a&lVOTE SYSTEM&8]"
- send " &7A list of the people who have voted the most."
- send ""
- loop {votifierTopList::*}:
- send "&8- %loop-value%"
- add 1 to {_n}
- {_n} is 10: #How many users that should be send in the chat.
- exit loop
- send ""
- send " &aYou can vote and receive free rewards using /vote"
- send ""
- every 20 minutes: #How often the list should be reloading the top data.
- loadTopVotes()
- function loadTopVotes(): #Yes this method is maybe not the smartest way to do it. :D
- delete {votifierTopList::*}
- loop {votes::topStats::*}:
- add 1 to {_size}
- if {_low.to.high.list::%loop-value%} is not set:
- set {_low.to.high.list::%loop-value%} to loop-index
- else:
- set {_n} to 0
- loop {_size} times:
- set {_n} to {_n}+1
- {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
- set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
- stop loop
- wait 1 tick
- set {_n} to size of {_low.to.high.list::*}
- loop {_low.to.high.list::*}:
- set {_high.to.low.list::%{_n}%} to loop-value
- set {_n} to {_n}-1
- loop {_high.to.low.list::*}:
- add 1 to {_topnumber}
- set {_player} to "%loop-value%" parsed as offlineplayer
- {_topnumber} = 1:
- set {_color} to "&a"
- else if {_topnumber} = 2:
- set {_color} to "&e"
- else if {_topnumber} = 3:
- set {_color} to "&c"
- else:
- set {_color} to "&7"
- set {votifierTopList::%{_topnumber}%} to "&8[%{_color}%&l##%{_topnumber}%&8] &f%{_player}% &8- %{_color}%%{votes::topStats::%loop-value%}% votes"
- add 1 to {_i}
- if {_topnumber} > 10:
- stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement