Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.
If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!
Now, what are you waiting for? Join the community now!
You can always check out skUnity Downloads for downloads and any other information about Skript!
Try:Ok I am a fairly new "Skripter" and I have never tried to do a leaderboard, so I was wondering, could anyone give me a "Top Blocks Mined" leaderboard? Or even like "Top Prestige" or "Top Coins" would be awesome, thanks!
on join:
{blocksmined::%player%} is not set:
set {blocksmined::%player%} to 0
on mine:
add 1 to {blocksmined::%player%}
on command "/minerstop":
cancel event
sender is a player:
loop {blocksmined::*}:
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
wait 1 tick
set {_i} to 0
message "&8&m----&6&lTop blocks mined&8&m----" to player
loop {_high.to.low.list::*}:
add 1 to {_topnumber}
set {_player} to "%loop-value%" parsed as offlineplayer
add 1 to {_i}
message "&7%{_topnumber}%.- &6%{_player}% &8» &7%{blocksmined::%loop-value%}% Blocks mined"
if {_topnumber} > 9:
stop loop
message "&f " to player
It doesn't work but I was able to fix a few things but not all. You should try it yourself in your own server xDTry:
code_language.skript:on join: {blocksmined::%player%} is not set: set {blocksmined::%player%} to 0 on mine: add 1 to {blocksmined::%player%} on command "/minerstop": cancel event sender is a player: loop {blocksmined::*}: 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 wait 1 tick set {_i} to 0 message "&8&m----&6&lTop blocks mined&8&m----" to player loop {_high.to.low.list::*}: add 1 to {_topnumber} set {_player} to "%loop-value%" parsed as offlineplayer add 1 to {_i} message "&7%{_topnumber}%.- &6%{_player}% &8» &7%{blocksmined::%loop-value%}% Blocks mined" if {_topnumber} > 9: stop loop message "&f " to player
I tried it on my localhost server and it works:It doesn't work but I was able to fix a few things but not all. You should try it yourself in your own server xD
I tried it on my localhost server and it works:
First, mine detection:
https://gyazo.com/01b770f77aafd490e175db48d59ad25b
Second, top list:
https://gyazo.com/26980ab84439fa0613a6ecf7b6a2a2a6
Well, it was my localhost server. Therefore, i have most addons to test without errors. These i have:What addons do you have
Well, it was my localhost server. Therefore, i have most addons to test without errors. These i have:
MundoSk, Skellett, SkQuery, skRayFall, skript-mirror, TuSKe.
If the code works, mark the post as solved.Its fine now, I just quit on my MC server because the owner was being a bitch to me :/