Sidebar will not show up.

  • Welcome to skUnity!

    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 community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

BaddCamden

Member
Nov 18, 2019
25
0
0
America
I was trying to make a sidebar for a minigame that would display the players and time to wait, but while fixing something, the sidebar will no longer show up. Also, if there is any way to update the player count, that would be divine.

Code:
on load:
clear {zombiesurvival.players::*}
clear {zombiesurvival.numplayers}
loop all players:
wipe loop-player's sidebar
set {zombiesurvival.timetillstart} to 120


function ClearVariable():
clear {zombiesurvival.players::*}
clear {zombiesurvival.numplayers}
clear {zombiesurvival.teleportplayersloop}
set {zombiesurvival.timetillstart} to 120

every second:
clear {zombiesurvival.players::*}
clear {zombiesurvival.numplayers}
loop all players in world "ZombieSurvival":
add loop-player to {zombiesurvival.players::*}
set {zombiesurvival.numplayers} to size of {zombiesurvival.players::*}
set {_zombiesurvival.loopplayer} to loop-player
set name of sidebar of {_zombiesurvival.loopplayer} to " &bZombie Survival "
set score "&aPlayers: &d%{zombiesurvival.numplayers}%/6" in sidebar of {_zombiesurvival.loopplayer} to 2
if {zombiesurvival.numplayers} is less than 2:
set id based score "&1Waiting for more players..." in sidebar of {_zombiesurvival.loopplayer} to 1 with id "idB"
remove score with id "idA"
if {zombiesurvival.numplayers} is greater than 1:
remove score with id "idA"
remove score with id "idB"
set id based score "&1%{zombiesurvival.timetillstart}% seconds to wait for more players." in sidebar of {_zombiesurvival.loopplayer} to 1 with id "idA"
if {zombiesurvival.timetillstart} is greater than 0:
set {zombiesurvival.timetillstart} to {zombiesurvival.timetillstart} - 1
if {zombiesurvival.timetillstart} is less than 1:
teleport loop-player to location at 181, 4, -133 in world "ZombieSurvivalA"
set {zombiesurvival.teleportplayersloop} to {zombiesurvival.teleportplayersloop} + 1
if {zombiesurvival.teleportplayersloop} is equal to {zombiesurvival.numplayers}:
ClearVariable()
wait 1 second
if loop-player isn't in world "ZombieSurvival":
wipe loop-player's sidebar

on player world change:
if world is "ZombieSurvival":
if {_zombiesurvival.numplayers} is greater than 6:
execute player command "/mvtp %player% lobbyworld"


Plugins:
Skript, skquery, skvault, skrayfall
 
Status
Not open for further replies.