ArtzifyHD

elo

Aug 6th, 2017
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. #EloSk 1.0
  2. #Made by imOfflinezzz - special for SkUnity
  3.  
  4.  
  5. #
  6. #Stuff
  7. #
  8.  
  9. on quit:
  10. if {elo::%player%} is 0:
  11. delete {elo::%player%}
  12.  
  13. function RateElo(a: player, v: player):
  14. set {_ega} to 25
  15. set {_egv} to 1
  16. set {_eloa} to {elo::%{_a}%}
  17. if {elo::%{_a}%} isn't set:
  18. set {_eloa} to 0
  19. set {_na} to 0
  20. set {_elov} to {elo::%{_v}%}
  21. if {elo::%{_v}%} isn't set:
  22. set {_elov} to 0
  23. set {_nv} to 0
  24. if {_eloa} is more than 99:
  25. while {_eloa} is more than 99:
  26. add 1 to {_na}
  27. remove 100 from {_eloa}
  28. loop {_na} times:
  29. {_ega} is more than 5
  30. remove 1 from {_ega}
  31. add {_ega} to {elo::%{_a}%}
  32. set {_elo.top::*} to sorted {elo::*} from highest to lowest with output "@value"
  33. loop {_elo.top::*}:
  34. set {_value} to "%loop-value%"
  35. replace all ".0" in {_value} with ""
  36. if "%{elo::%{_a}%}%" is "%{_value}%":
  37. set {_la} to loop-index
  38. send "&7You gained &a%{_ega}% &eELO &7(Current ELO is &a%{elo::%{_a}%}%&7 - &e##%{_la}% &7in Global Leaderboard)" to {_a}
  39. if {_elov} is more than 499:
  40. while {_elov} is more than 499:
  41. add 1 to {_nv}
  42. remove 100 from {_elov}
  43. loop {_nv} times:
  44. {_egv} is less than 20
  45. add 2 to {_egv}
  46. if {elo::%{_v}%} is more than 0:
  47. remove {_egv} from {elo::%{_v}%}
  48. set {_elo.top::*} to sorted {elo::*} from highest to lowest with output "@value"
  49. loop {_elo.top::*}:
  50. set {_value} to "%loop-value%"
  51. replace all ".0" in {_value} with ""
  52. if "%{elo::%{_v}%}%" is "%{_value}%":
  53. set {_lv} to loop-index
  54. send "&7You lost &c%{_egv}% &eELO &7(Current ELO is &c%{elo::%{_v}%}% &7- &e##%{_lv}% &7in Global Leaderboard)" to {_v}
  55.  
  56. on death of player:
  57. attacker is a player
  58. RateElo(attacker, victim)
  59. #wait 2 ticks
  60. #force respawn player
  61.  
  62. command /top10:
  63. trigger:
  64. set {_elo.top::*} to sorted {elo::*} from highest to lowest with output "&7@index &7with &e@value ELO"
  65. set {_x} to 1
  66. send "&7=========&aTop 10 Players&7========="
  67. loop 10 times:
  68. set {_v} to "%{_elo.top::%{_x}%}%"
  69. replace all ".0" in {_v} with ""
  70. if {_x} is 1:
  71. replace all "&7" in {_v} with "&a"
  72. if {_x} is 2 :
  73. replace all "&7" in {_v} with "&b"
  74. if {_x} is 3:
  75. replace all "&7" in {_v} with "&e"
  76. send "&e##%{_x}% %{_v}%" to player
  77. add 1 to {_x}
  78. if size of {elo::*} is less than {_x}:
  79. exit loop
  80. send "&7================================"
  81.  
  82. command /elosk [<text>]:
  83. trigger:
  84. if executor is a player:
  85. player doesn't have permission "elosk.admin"
  86. send "&cYou don't have permissions" to player
  87. stop trigger
  88. if arg-1 is "reset-signs":
  89. delete {elo.signs::*}
  90. if arg-1 is "wipe-all-elo":
  91. delete {elo::*}
  92.  
  93. on left click with orange dye:
  94. player's gamemode is creative
  95. player has permission "elosk.admin"
  96. add location of clicked block to {elo.signs::*}
  97. send "&aELO sign added"
  98. cancel the event
  99.  
  100. every 60 seconds:
  101. set {_elo.top::*} to sorted {elo::*} from highest to lowest with output "@index;@value"
  102. set {_x} to 1
  103. loop {_elo.top::*}:
  104. set {_lv} to "%loop-value%" parsed as text
  105. set {_iv::*} to {_lv} split at ";"
  106. set {_i.%{_x}%} to {_iv::1}
  107. set {_v.%{_x}%} to {_iv::2}
  108. replace all ".0" with "" in {_v.%{_x}%}
  109. add 1 to {_x}
  110. set {_x} to 1
  111. loop 10 times:
  112. loop {elo.signs::*}:
  113. if block at loop-value-2 is sign:
  114. loop 10 times:
  115. if line 1 of block at loop-value-2 is "##%{_x}%":
  116. set {_i.%{_x}%} to "%{_i.%{_x}%}%" parsed as offline player
  117. set {_i.%{_x}%} to display name of {_i.%{_x}%}
  118. if {_i.%{_x}%} is "<none>":
  119. set {_i.%{_x}%} to "???"
  120. if {_v.%{_x}%} isn't set:
  121. set {_v.%{_x}%} to "???"
  122. set line 2 of block at loop-value-2 to "%{_i.%{_x}%}%"
  123. set line 3 of block at loop-value-2 to "%{_v.%{_x}%}%"
  124. wait 1 tick
  125. else:
  126. remove loop-value-2 from {elo.signs::*}
  127. add 1 to {_x}
Advertisement
Add Comment
Please, Sign In to add comment