Couldn't make the one list variable work for all the sings unfortunately, but elsewise this is functional~
How to - define the top bal signs as [top bal 1], [top bal 2], and so on. You only need to type it on the first line, and everything else will work automatically. It updates every 5 min, but the /signupdate command will force an update. balances are set on join and quit, but you could add it at other points too
code_language.skript:
command /signupdate:
trigger:
loop {plr.bal::*}:
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
if {_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 {_line} to 1
loop {_high.to.low.list::*}:
set {_player} to "%loop-value%" parsed as offlineplayer
send " &1%{_player}% - &7%{plr.bal::%loop-value%}%"
set line {_line} of {signlist::1} to "%{_player}%"
add 1 to {_line}
if {_line} is 4:
set line {_line} of {signlist::2} to "%{_player}%"
if {_line} is 8:
set line {_line} of {signlist::2} to "%{_player}%"
if {_line} is 12:
set line {_line} of {signlist::2} to "%{_player}%"
if {_line} is 16:
set line {_line} of {signlist::2} to "%{_player}%"
on sign change:
if line 1 is "[Top Bal 1]":
send "&1Top Bal sign 1 placed"
set line 1 to ""
set {sign1::1} to block at event-location
if line 1 is "[Top Bal 2]":
send "&1Top Bal sign 1 placed"
set line 1 to ""
set {sign1::2} to block at event-location
if line 1 is "[Top Bal 3]":
send "&1Top Bal sign 1 placed"
set line 1 to ""
set {sign1::3} to block at event-location
if line 1 is "[Top Bal 4]":
send "&1Top Bal sign 1 placed"
set line 1 to ""
set {sign1::4} to block at event-location
if line 1 is "[Top Bal 5]":
send "&1Top Bal sign 1 placed"
set line 1 to ""
set {sign1::5} to block at event-location
on join:
set {plr.bal::%player%} to "%player's balance%"
on quit:
set {plr.bal::%player%} to "%player's balance%"
every 5 minutes:
execute console command "/signupdate"