Advertisement
Guest User

Minecraft-list.gg | Vote Top List

a guest
Mar 26th, 2024
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. #Skript publiched on https://minecraft-list.gg
  2.  
  3. on load:
  4. loadTopVotes()
  5.  
  6. command /clearvotestop: #Clear the data from the leaderboard.
  7. permission: *
  8. trigger:
  9. delete {votes::topStats::*}
  10. wait 2 ticks
  11. loadTopVotes()
  12. send "You cleared the current leaderboard."
  13.  
  14. command /topvotes:
  15. trigger:
  16. send "&8[ &a&lVOTE SYSTEM&8]"
  17. send " &7A list of the people who have voted the most."
  18. send ""
  19. loop {votifierTopList::*}:
  20. send "&8- %loop-value%"
  21. add 1 to {_n}
  22. {_n} is 10: #How many users that should be send in the chat.
  23. exit loop
  24. send ""
  25. send " &aYou can vote and receive free rewards using /vote"
  26. send ""
  27.  
  28. every 20 minutes: #How often the list should be reloading the top data.
  29. loadTopVotes()
  30.  
  31. function loadTopVotes(): #Yes this method is maybe not the smartest way to do it. :D
  32. delete {votifierTopList::*}
  33. loop {votes::topStats::*}:
  34. add 1 to {_size}
  35. if {_low.to.high.list::%loop-value%} is not set:
  36. set {_low.to.high.list::%loop-value%} to loop-index
  37. else:
  38. set {_n} to 0
  39. loop {_size} times:
  40. set {_n} to {_n}+1
  41. {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
  42. set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
  43. stop loop
  44. wait 1 tick
  45. set {_n} to size of {_low.to.high.list::*}
  46. loop {_low.to.high.list::*}:
  47. set {_high.to.low.list::%{_n}%} to loop-value
  48. set {_n} to {_n}-1
  49. loop {_high.to.low.list::*}:
  50. add 1 to {_topnumber}
  51. set {_player} to "%loop-value%" parsed as offlineplayer
  52. {_topnumber} = 1:
  53. set {_color} to "&a"
  54. else if {_topnumber} = 2:
  55. set {_color} to "&e"
  56. else if {_topnumber} = 3:
  57. set {_color} to "&c"
  58. else:
  59. set {_color} to "&7"
  60. set {votifierTopList::%{_topnumber}%} to "&8[%{_color}%&l##%{_topnumber}%&8] &f%{_player}% &8- %{_color}%%{votes::topStats::%loop-value%}% votes"
  61. add 1 to {_i}
  62. if {_topnumber} > 10:
  63. stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement