I am having issues with my /toggle command, the scoreboard functions properly and /toggle switches between them but when a player enables the scoreboard then decides to disconnect & rejoin the scoreboard doesn't display on. I assume I have messed up somewhere within my on join event, if anyone could help out I'd really appreciate it. Thanks!
Video of the issue:
Addons installed: SkBee, Skellet, SkQuery, TuSKe, SkRayfall
Video of the issue:
Addons installed: SkBee, Skellet, SkQuery, TuSKe, SkRayfall
Code:
function Scoreboard(player: player):
set title of {_player}'s scoreboard to " &7»&r &a&lSk&2&lFarming &7« "
set line 5 of {_player}'s scoreboard to "&5&l"# in sidebar of {_player} to 5
set line 4 of {_player}'s scoreboard to "&3» &7&lNAME &a%{_player}%"# in sidebar of {_player} to 4
set line 3 of {_player}'s scoreboard to "&3» &7&lONLINE &c%{online_players}%"# in sidebar of {_player} to 3
set line 2 of {_player}'s scoreboard to "&5&l"# in sidebar of {_player} to 2
set line 1 of {_player}'s scoreboard to "&b&l"# in sidebar of {_player} to 1
command /toggle [<text>]:
trigger:
if {show_info::%player%} is not set:
set {show_info::%player%} to true
toggle player's scoreboard to on
send "&7Enabled your scoreboard." to player
else:
delete {show_info::%player%}
toggle player's scoreboard to off
send "&7Disabled your scoreboard." to player
on join:
clear player's scoreboard
while player is online:
Scoreboard(player)
wait 10 ticks