Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #EloSk 1.0
- #Made by imOfflinezzz - special for SkUnity
- #
- #Stuff
- #
- on quit:
- if {elo::%player%} is 0:
- delete {elo::%player%}
- function RateElo(a: player, v: player):
- set {_ega} to 25
- set {_egv} to 1
- set {_eloa} to {elo::%{_a}%}
- if {elo::%{_a}%} isn't set:
- set {_eloa} to 0
- set {_na} to 0
- set {_elov} to {elo::%{_v}%}
- if {elo::%{_v}%} isn't set:
- set {_elov} to 0
- set {_nv} to 0
- if {_eloa} is more than 99:
- while {_eloa} is more than 99:
- add 1 to {_na}
- remove 100 from {_eloa}
- loop {_na} times:
- {_ega} is more than 5
- remove 1 from {_ega}
- add {_ega} to {elo::%{_a}%}
- set {_elo.top::*} to sorted {elo::*} from highest to lowest with output "@value"
- loop {_elo.top::*}:
- set {_value} to "%loop-value%"
- replace all ".0" in {_value} with ""
- if "%{elo::%{_a}%}%" is "%{_value}%":
- set {_la} to loop-index
- send "&7You gained &a%{_ega}% &eELO &7(Current ELO is &a%{elo::%{_a}%}%&7 - &e##%{_la}% &7in Global Leaderboard)" to {_a}
- if {_elov} is more than 499:
- while {_elov} is more than 499:
- add 1 to {_nv}
- remove 100 from {_elov}
- loop {_nv} times:
- {_egv} is less than 20
- add 2 to {_egv}
- if {elo::%{_v}%} is more than 0:
- remove {_egv} from {elo::%{_v}%}
- set {_elo.top::*} to sorted {elo::*} from highest to lowest with output "@value"
- loop {_elo.top::*}:
- set {_value} to "%loop-value%"
- replace all ".0" in {_value} with ""
- if "%{elo::%{_v}%}%" is "%{_value}%":
- set {_lv} to loop-index
- send "&7You lost &c%{_egv}% &eELO &7(Current ELO is &c%{elo::%{_v}%}% &7- &e##%{_lv}% &7in Global Leaderboard)" to {_v}
- on death of player:
- attacker is a player
- RateElo(attacker, victim)
- #wait 2 ticks
- #force respawn player
- command /top10:
- trigger:
- set {_elo.top::*} to sorted {elo::*} from highest to lowest with output "&7@index &7with &e@value ELO"
- set {_x} to 1
- send "&7=========&aTop 10 Players&7========="
- loop 10 times:
- set {_v} to "%{_elo.top::%{_x}%}%"
- replace all ".0" in {_v} with ""
- if {_x} is 1:
- replace all "&7" in {_v} with "&a"
- if {_x} is 2 :
- replace all "&7" in {_v} with "&b"
- if {_x} is 3:
- replace all "&7" in {_v} with "&e"
- send "&e##%{_x}% %{_v}%" to player
- add 1 to {_x}
- if size of {elo::*} is less than {_x}:
- exit loop
- send "&7================================"
- command /elosk [<text>]:
- trigger:
- if executor is a player:
- player doesn't have permission "elosk.admin"
- send "&cYou don't have permissions" to player
- stop trigger
- if arg-1 is "reset-signs":
- delete {elo.signs::*}
- if arg-1 is "wipe-all-elo":
- delete {elo::*}
- on left click with orange dye:
- player's gamemode is creative
- player has permission "elosk.admin"
- add location of clicked block to {elo.signs::*}
- send "&aELO sign added"
- cancel the event
- every 60 seconds:
- set {_elo.top::*} to sorted {elo::*} from highest to lowest with output "@index;@value"
- set {_x} to 1
- loop {_elo.top::*}:
- set {_lv} to "%loop-value%" parsed as text
- set {_iv::*} to {_lv} split at ";"
- set {_i.%{_x}%} to {_iv::1}
- set {_v.%{_x}%} to {_iv::2}
- replace all ".0" with "" in {_v.%{_x}%}
- add 1 to {_x}
- set {_x} to 1
- loop 10 times:
- loop {elo.signs::*}:
- if block at loop-value-2 is sign:
- loop 10 times:
- if line 1 of block at loop-value-2 is "##%{_x}%":
- set {_i.%{_x}%} to "%{_i.%{_x}%}%" parsed as offline player
- set {_i.%{_x}%} to display name of {_i.%{_x}%}
- if {_i.%{_x}%} is "<none>":
- set {_i.%{_x}%} to "???"
- if {_v.%{_x}%} isn't set:
- set {_v.%{_x}%} to "???"
- set line 2 of block at loop-value-2 to "%{_i.%{_x}%}%"
- set line 3 of block at loop-value-2 to "%{_v.%{_x}%}%"
- wait 1 tick
- else:
- remove loop-value-2 from {elo.signs::*}
- add 1 to {_x}
Advertisement
Add Comment
Please, Sign In to add comment