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!
I got a console error.I don't think RandomSK sorting works very well anymore (not 100% sure). Try using Bensku's one
```
set {_sorted::*} to sorted {var::*}
```
usefull informantion...I got a console error.
loop {kill::*}:#change here your variables.
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
send "&7&m-----------&8< &6Top10 &8>&7&m-----------"
loop {_high.to.low.list::*}:
add 1 to {_topnumber}
set {_player} to "%loop-value%" parsed as offlineplayer
send "&7%{_topnumber}% - &c%{_player}% &8» &7%{kill::%loop-value%}% Kills"
add 1 to {_i}
if {_topnumber} > 9:
stop
send "&7&m------------------------------"
else if arg-1 is "top":
set {_guilds::*} to directory "AGDATABASE/guilds/"'s files
send "&c&lCOLLECTING DATA..."
loop {_guilds::*}:
set {_guilds2::all::*} to "%loop-value%"
replace "/home" with "" in {_guilds2::all::*}
replace "/gs" with "" in {_guilds2::all::*}
replace "/data" with "" in {_guilds2::all::*}
replace "/servers" with "" in {_guilds2::all::*}
replace "/5101781" with "" in {_guilds2::all::*}
replace "/AGDATABASE/guilds/" with "" in {_guilds2::all::*}
replace ".yml" with "" in {_guilds2::all::*}
set {_guilds2::kills::*} to skutilities yml list "kills" from file "AGDATABASE/guilds/%{_guilds2::all::*}%.yml"
set {_Toplist::*} to sorted {_guilds2::kills::*} #with output "@index %{_guilds2::all::*}% -- %{_guilds2::kills::*}%"
loop {_Toplist::*}:
add 1 to {_size}
if {_low.to.high.list::%loop-value-2%} is not set:
set {_low.to.high.list::%loop-value-2%} to loop-index-2
else:
set {_n} to 0
loop {_size} times:
set {_n} to {_n}+1
{_low.to.high.list::%loop-value-3%.%{_n}%} is not set
set {_low.to.high.list::%loop-value-3%.%{_n}%} to loop-index-2
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-2
set {_n} to {_n}-1
wait 1 tick
set {_i} to 0
send "&7&m-----------&8< &6Top10 &8>&7&m-----------"
loop {_high.to.low.list::*}:
add 1 to {_topnumber}
set {_player} to "%loop-value-2%"
send "&7%{_topnumber}% - &c%{_player}% &8» &7%{kill::%loop-value-2%}% Kills"
add 1 to {_i}
if {_topnumber} > 9:
stop
send "&7&m------------------------------"
Uhm. little wirred... wait i will try...@ChisleLP
Here's my code
code_language.skript:else if arg-1 is "top": set {_guilds::*} to directory "AGDATABASE/guilds/"'s files send "&c&lCOLLECTING DATA..." loop {_guilds::*}: set {_guilds} to "%loop-value%" replace "/home" with "" in {_guilds} replace "/gs" with "" in {_guilds} replace "/data" with "" in {_guilds} replace "/servers" with "" in {_guilds} replace "/5101781" with "" in {_guilds} replace "/AGDATABASE/guilds/" with "" in {_guilds} replace ".yml" with "" in {_guilds} set {_guilds2::kills::*} to skutilities yml list "kills" from file "AGDATABASE/guilds/%{_guilds2::all::*}%.yml" set {_Toplist::*} to sorted {_guilds2::kills::*} #with output "@index %{_guilds2::all::*}% -- %{_guilds2::kills::*}%" loop {_Toplist::*}: add 1 to {_size} if {_low.to.high.list::%loop-value-2%} is not set: set {_low.to.high.list::%loop-value-2%} to loop-index-2 else: set {_n} to 0 loop {_size} times: set {_n} to {_n}+1 {_low.to.high.list::%loop-value-3%.%{_n}%} is not set set {_low.to.high.list::%loop-value-3%.%{_n}%} to loop-index-2 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-2 set {_n} to {_n}-1 wait 1 tick set {_i} to 0 send "&7&m-----------&8< &6Top10 &8>&7&m-----------" loop {_high.to.low.list::*}: add 1 to {_topnumber} set {_player} to "%loop-value-2%" send "&7%{_topnumber}% - &c%{_player}% &8» &7%{kill::%loop-value-2%}% Kills" add 1 to {_i} if {_topnumber} > 9: stop send "&7&m------------------------------"
Here's my results >
else if arg-1 is "top":
set {_guilds::*} to directory "AGDATABASE/guilds/"'s files
send "&c&lCOLLECTING DATA..."
loop {_guilds::*}:
set {_Group} to "%loop-value%"
replace "/home" with "" in {_Group}
replace "/gs" with "" in {_Group}
replace "/data" with "" in {_Group}
replace "/servers" with "" in {_Group}
replace "/5101781" with "" in {_Group}
replace "/AGDATABASE/guilds/" with "" in {_Group}
replace ".yml" with "" in {_Group}
set {_GroupKills::%{_group}%} to skutilities yml list "kills" from file "AGDATABASE/guilds/%{_Group}%.yml"
loop {_GroupKills::*}:
add 1 to {_size}
if {_low.to.high.list::%loop-value-2%} is not set:
set {_low.to.high.list::%loop-value-2%} to loop-index-2
else:
set {_n} to 0
loop {_size} times
set {_n} to {_n}+1
{_low.to.high.list::%loop-value-3%.%{_n}%} is not set
set {_low.to.high.list::%loop-value-3%.%{_n}%} to loop-index-2
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-2
set {_n} to {_n}-1
wait 1 tick
set {_i} to 0
send "&7&m-----------&8< &6Top10 &8>&7&m-----------"
loop {_high.to.low.list::*}:
add 1 to {_topnumber}
set {_Group} to "%loop-value-2%"
send "&7%{_topnumber}% - &c%{_player}% &8» &7%{_GroupKills::%loop-value-2%}% Kills"
add 1 to {_i}
if {_topnumber} > 9:
stop
send "&7&m------------------------------"
Uhm. little wirred... wait i will try...
code_language.skript:else if arg-1 is "top": set {_guilds::*} to directory "AGDATABASE/guilds/"'s files send "&c&lCOLLECTING DATA..." loop {_guilds::*}: set {_Group} to "%loop-value%" replace "/home" with "" in {_Group} replace "/gs" with "" in {_Group} replace "/data" with "" in {_Group} replace "/servers" with "" in {_Group} replace "/5101781" with "" in {_Group} replace "/AGDATABASE/guilds/" with "" in {_Group} replace ".yml" with "" in {_Group} set {_GroupKills::%{_group}%} to skutilities yml list "kills" from file "AGDATABASE/guilds/%{_Group}%.yml" loop {_GroupKills::*}: add 1 to {_size} if {_low.to.high.list::%loop-value-2%} is not set: set {_low.to.high.list::%loop-value-2%} to loop-index-2 else: set {_n} to 0 loop {_size} times set {_n} to {_n}+1 {_low.to.high.list::%loop-value-3%.%{_n}%} is not set set {_low.to.high.list::%loop-value-3%.%{_n}%} to loop-index-2 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-2 set {_n} to {_n}-1 wait 1 tick set {_i} to 0 send "&7&m-----------&8< &6Top10 &8>&7&m-----------" loop {_high.to.low.list::*}: add 1 to {_topnumber} set {_Group} to "%loop-value-2%" send "&7%{_topnumber}% - &c%{_player}% &8» &7%{_GroupKills::%loop-value-2%}% Kills" add 1 to {_i} if {_topnumber} > 9: stop send "&7&m------------------------------"
this should works. i have renamed the variables. You don#t need list it... and you don#t need Sorted.
##edit
sorry. forget to changed variables in replace
well... wtf... this is the reason... uhmmm wait then do this
set {_Kills::*} to yaml list "kills" from file "AGDATABASE/guilds/%{_groups}%"
set {_GroupsKills::%{_Groups}%} to {_Kills::1}
well... wtf... this is the reason... uhmmm wait then do this
code_language.skript:set {_Kills::*} to yaml list "kills" from file "AGDATABASE/guilds/%{_groups}%" set {_GroupsKills::%{_Groups}%} to {_Kills::1}