The Code after For Loop is Not Running

  1. What do you want to achieve? after the for loop is finished a frame that is disabled currently must be enabled + another frame will changing its x position to 1 (tween position)

  2. What is the issue? after for loop, it’s not running and it starts from beginning

So is there any problem to fix this issue ? is it because i m using a while loop and inside a for loop?

--Length Variables
local roundLength = 180
local gameStartLength = 5

--Guis
local bgFinderHider = game.StarterGui.Bg
local finderHiderChoosingFrame = game.StarterGui.HiderFinderGui.FinderBGGui


game.Players.PlayerAdded:Connect(function(player)
	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")
	
	--Starting Game
	while wait() do
		
		--Checking if there are enough players to Start the Game
		if playerCount >= 1 then
			for i = gameStartLength,0,-1 do
				
				roundStatus.Value = false
				wait(1)
				gameStatus.Value = "Game Starts in "..i.." Seconds"
				
			end
			
			bgFinderHider.Enabled = true

			finderHiderChoosingFrame:TweenPosition(
				UDim2.new(0.258,0,0.2,0),
				"In",
				"Quad",
				2,
				false
			)
			wait(5)
		else
			gameStatus.Value = "Waiting for Enough Players..."
		end
	end
	
end)
1 Like

when i check it enable the bg but its not visible in the game.

1 Like

hum it is working, what i changed is removed the startergui and changed to playergui. Thus it got worked

2 Likes