For One Person Only GUI Appears in the Game

  1. What do you want to achieve? I want to show the GUI for all the players in the game when the timer is 0

  2. What is the issue? the GUI is only showing for the person who joined first

  3. What solutions have you tried so far? I tried some solutions but not working

Btw there is a hider who is chosen randomly from the players.

  

  --Length Variables
local roundLength = game.ReplicatedStorage.roundLength
local gameStartLength = game.ReplicatedStorage.gameStartLength


while wait() do
	
	for _,player in pairs(game.Players:GetPlayers()) do


		wait(10)

		-- Player Count
		local playerCount = #game.Players:GetPlayers()

		--Game Status 
		local gameStatus = game.ReplicatedStorage.gameStatus
		gameStatus.Value = "Waiting for Game to Start..."

		--Round Status 
		local roundStatus = player.PlayerGui:WaitForChild("InRound")

		--Guis
		local bgFinderHider = player.PlayerGui.Bg
		local finderHiderChoosingFrame = player.PlayerGui.HiderFinderGui.FinderBGGui

		--Texts
		local hiderFinderText = finderHiderChoosingFrame.Frame.TextLabel

		--Starting Game
		while wait() do

			--Checking if there are enough players to Start the Game
			if playerCount >= 1 then
				for i = gameStartLength.Value,0,-1 do

					roundStatus.Value = false
					wait(1)
					gameStatus.Value = "Game Starts in "..i.." Seconds"
					bgFinderHider.Enabled = false

				end

				-- choosing a hider from the players in the game
				local hider = game.Players:GetChildren()[math.random(1,#game.Players:GetChildren())]
				local hiderBGGui = hider.PlayerGui.Bg
				local hiderFinderHiderChoosingFrame = hider.PlayerGui.HiderFinderGui.FinderBGGui 
				local hiderFinderHiderText = hiderFinderHiderChoosingFrame.Frame.TextLabel

				print(hider.Name)

				bgFinderHider.Enabled = true
				
				hiderBGGui.Enabled = false

				hiderFinderHiderChoosingFrame:TweenPosition(
					UDim2.new(0.258,0,0.2,0),
					"In",
					"Quad",
					1,
					false
				)
				
				finderHiderChoosingFrame:TweenPosition(
					UDim2.new(0.258,0,0.2,0),
					"In",
					"Quad",
					1,
					false
				)

				--TypeWriter Function
				local function typeWrite(object, text) 
					for i = 1,#text,1  do
						wait(0.3)
						object.Text = string.sub(text,1,i)
					end
				end

				wait(2)

				-- Checking if player is a hider or not and showing them the text
				if player ~= hider then

					typeWrite(hiderFinderText, 'Finder')

				else

					typeWrite(hiderFinderHiderText, 'Hider')

				end



				wait(5) 

				hiderFinderHiderChoosingFrame:TweenPosition(
					UDim2.new(0.258,0,1,0),
					"Out",
					"Quad",
					1,
					false
				)
				
				finderHiderChoosingFrame:TweenPosition(
					UDim2.new(0.258,0,1,0),
					"Out",
					"Quad",
					1,
					false
				)

				wait(1)

				hiderFinderText.Text = ""
				hiderFinderHiderText.Text = ""

			else
				gameStatus.Value = "Waiting for Enough Players..."
			end
		end




	end


	
end

Please if any one knows a solution for this issue, then please tell me :frowning:

2 Likes

this was the the code:

--Length Variables
local roundLength = game.ReplicatedStorage.roundLength
local gameStartLength = game.ReplicatedStorage.gameStartLength


while wait() do
	
	for _,player in pairs(game.Players:GetPlayers()) do


		wait(10)

		-- Player Count
		local playerCount = #game.Players:GetPlayers()

		--Game Status 
		local gameStatus = game.ReplicatedStorage.gameStatus
		gameStatus.Value = "Waiting for Game to Start..."

		--Round Status 
		local roundStatus = player.PlayerGui:WaitForChild("InRound")

		--Guis
		local bgFinderHider = player.PlayerGui.Bg
		local finderHiderChoosingFrame = player.PlayerGui.HiderFinderGui.FinderBGGui

		--Texts
		local hiderFinderText = finderHiderChoosingFrame.Frame.TextLabel

		--Starting Game
		while wait() do

			--Checking if there are enough players to Start the Game
			if playerCount >= 1 then
				for i = gameStartLength.Value,0,-1 do

					roundStatus.Value = false
					wait(1)
					gameStatus.Value = "Game Starts in "..i.." Seconds"
					bgFinderHider.Enabled = false

				end

				-- choosing a hider from the players in the game
				local hider = game.Players:GetChildren()[math.random(1,#game.Players:GetChildren())]

				print(hider.Name)

				bgFinderHider.Enabled = true


				finderHiderChoosingFrame:TweenPosition(
					UDim2.new(0.258,0,0.2,0),
					"In",
					"Quad",
					1,
					false
				)

				--TypeWriter Function
				local function typeWrite(object, text) 
					for i = 1,#text,1  do
						wait(0.3)
						object.Text = string.sub(text,1,i)
					end
				end

				wait(2)

				-- Checking if player is a hider or not and showing them the text
				if player ~= hider then

					typeWrite(hiderFinderText, 'Finder')

				else

					typeWrite(hiderFinderText, 'Hider')

				end

				wait(5)

				finderHiderChoosingFrame:TweenPosition(
					UDim2.new(0.258,0,1,0),
					"Out",
					"Quad",
					1,
					false
				)

				wait(1)

				hiderFinderText.Text = ""

			else
				gameStatus.Value = "Waiting for Enough Players..."
			end
		end

	end

end

Here is a video on the Problem:

(Ignore my above post, I misread your post.)

ok i know.Curently my problem can be seen on this post : Gui only Shows for 1 Person

video:

code:

--Length Variables
local roundLength = game.ReplicatedStorage.roundLength
local gameStartLength = game.ReplicatedStorage.gameStartLength


while wait() do
	
	for _,player in pairs(game.Players:GetPlayers()) do


		wait(10)

		-- Player Count
		local playerCount = #game.Players:GetPlayers()

		--Game Status 
		local gameStatus = game.ReplicatedStorage.gameStatus
		gameStatus.Value = "Waiting for Game to Start..."

		--Round Status 
		local roundStatus = player.PlayerGui:WaitForChild("InRound")

		--Guis
		local bgFinderHider = player.PlayerGui.Bg
		local finderHiderChoosingFrame = player.PlayerGui.HiderFinderGui.FinderBGGui

		--Texts
		local hiderFinderText = finderHiderChoosingFrame.Frame.TextLabel

		--Starting Game
		while wait() do

			--Checking if there are enough players to Start the Game
			if playerCount >= 1 then
				for i = gameStartLength.Value,0,-1 do

					roundStatus.Value = false
					wait(1)
					gameStatus.Value = "Game Starts in "..i.." Seconds"
					bgFinderHider.Enabled = false

				end

				-- choosing a hider from the players in the game
				local hider = game.Players:GetChildren()[math.random(1,#game.Players:GetChildren())]

				print(hider.Name)

				bgFinderHider.Enabled = true


				finderHiderChoosingFrame:TweenPosition(
					UDim2.new(0.258,0,0.2,0),
					"In",
					"Quad",
					1,
					false
				)

				--TypeWriter Function
				local function typeWrite(object, text) 
					for i = 1,#text,1  do
						wait(0.3)
						object.Text = string.sub(text,1,i)
					end
				end

				wait(2)

				-- Checking if player is a hider or not and showing them the text
				if player ~= hider then

					typeWrite(hiderFinderText, 'Finder')

				else

					typeWrite(hiderFinderText, 'Hider')

				end



				wait(5)

				finderHiderChoosingFrame:TweenPosition(
					UDim2.new(0.258,0,1,0),
					"Out",
					"Quad",
					1,
					false
				)

				wait(1)

				hiderFinderText.Text = ""

			else
				gameStatus.Value = "Waiting for Enough Players..."
			end
		end




	end

end