I'm trying to sort "canemined" low to high, the skript currently it is putting them all into a message in chat but not ordered in the way I intended. I tried getting my head around this for ages and couldn't figure it out. It seems to be putting them in order low-to-high and then just putting values of zero at bottom.
I get the error message "{_n} can only be set to one object".
EDIT: I just looked and I get another error "Possible name conflict of variables {canemined::*} and {canemined::%player%}. - I'm not an expert with skript but I'm confident the sorting is because the {_n} issue I am just lost on how to fix it.
I get the error message "{_n} can only be set to one object".
EDIT: I just looked and I get another error "Possible name conflict of variables {canemined::*} and {canemined::%player%}. - I'm not an expert with skript but I'm confident the sorting is because the {_n} issue I am just lost on how to fix it.
Code:
on command "/canetop":
cancel event
sender is a player:
loop {canemined::*}:
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----&a&lCANETOP&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}%. &a%{_player}% &8: &7%{canemined::%loop-value%}% Cane Farmed"
if {_topnumber} > 9:
stop loop
message "&f " to player
Last edited: