#Code crashes

1 messages · Page 1 of 1 (latest)

elder glade
#

Hey guys, I'm currently making a leaderboard, but since I've added the second line, it doesnt work anymore and my logs are throwing huge errors

set display text of {_lb} to "%{_color}%#1 &8- &f%{_sorted::1} parsed as a offlineplayer% &8- %{_color}%%{lb::%{_sorted::1}%::%{_value}%}%%{_suffix}%" and "%{_color}%#2 &8- &f%{_sorted::2} parsed as a offlineplayer% &8- %{_color}%%{lb::%{_sorted::2}%::%{_value}%}%%{_suffix}%"

Since i added this, it doesnt work:

"%{_color}%#2 &8- &f%{_sorted::2} parsed as a offlineplayer% &8- %{_color}%%{lb::%{_sorted::2}%::%{_value}%}%%{_suffix}%"

I found out that {_sorted::2} crashes it, because for some reason it has 2 values assigned to it

#

Full code:

function updateLeaderboard(id: string, value: string, color: string, suffix: string):
    set {_lb} to {lb::leaderboards::%{_id}%}
    loop all players:
        set {_values::%loop-player's uuid%} to {lb::%loop-player's uuid%::%{_value}%}
        set {_sorted::*} to sorted indices of {_values::*} in descending order
        set display text of {_lb} to "&a&l&nBALANCE TOP" and "&7Refreshes every &f10min" and "&r " and "%{_color}%#2 &8- &f%{_sorted::2} parsed as a offlineplayer% &8- %{_color}%%{lb::%{_sorted::2}%::%{_value}%}%%{_suffix}%"```
elder glade
#

Still need help

sharp bloom
#

wth is that jungle of code

elder glade
sharp bloom
elder glade
#

still don't know why it crashes tho