The following is a code from a localscript called PlayerWaiter, it's main purpose is to wait until there are at least 2 players online and then start the game. My problem is only the second player that joins see the countdown. For example, one player joins a new game and is waiting, another player joins and now the countdown begins on the 2nd players screen. It does not appear on the 1st players screen though (if that is too confusing just ask me and I'll try to explain it better), anyways here is the code:
----------------------------------------------------------------------------------------------------
repeat wait() until game.Players.LocalPlayer.Character
print("PlayerWaiter script loading variables")
----------------------------------------------------------------------------------------------------
--Insert VARIABLES Below
----------------------------------------------------------------------------------------------------
players = #game.Players:GetPlayers()
PlayerNum = script.Parent.WaitingPlayers
gamestarted = false
----------------------------------------------------------------------------------------------------
print("Playerwaiter script working")
----------------------------------------------------------------------------------------------------
repeat wait()
PlayerNum.Text = "Waiting for players."
wait(.5)
PlayerNum.Text = "Waiting for players.."
wait(.5)
PlayerNum.Text = "Waiting for players..."
wait(1)
until players >= 2
repeat wait()
if players >= 2 then
PlayerNum.Text = "Starting in 10"
wait(1)
PlayerNum.Text = "Starting in 9"
wait(1)
PlayerNum.Text = "Starting in 8"
wait(1)
PlayerNum.Text = "Starting in 7"
wait(1)
PlayerNum.Text = "Starting in 6"
wait(1)
PlayerNum.Text = "Starting in 5"
wait(1)
PlayerNum.Text = "Starting in 4"
wait(1)
PlayerNum.Text = "Starting in 3"
wait(1)
PlayerNum.Text = "Starting in 2"
wait(1)
PlayerNum.Text = "Starting in 1"
wait(1)
PlayerNum.Text = "Starting Match"
end
until gamestarted == true

1 comment
So how do I go about fixing this?