Game round not working

Hello,

I’m Working On a tiles Game But The Round system Code is Not Working And I’m Not Getting Any Errors ?

THE CODE:

local roundlength = 120
local inmerssoinTime = 15
local InRound = game.ReplicatedStorage.InRound
local Status = game.ReplicatedStorage.Status

local GameAreaSpawn = workspace.GameAreaSpawn
local E = workspace.spawnparty

print("test")

InRound.Changed:Connect(function()
	print("pls")
	wait(1)
	if InRound.Value == true then
		print("EO")
		for _, player in pairs(game.Players:GetChildren()) do
			local char = player.Character
			char.HumanoidRootPart.CFrame = GameAreaSpawn.CFrame
		end
	else
		for _, player in pairs(game.Players:GetChildren()) do
			local char = player.Character
			char.HumanoidRootPart.CFrame = workspace.iseeu.CFrame
		end
	end
end)

local function roundTimer()
	while wait() do
		for i = inmerssoinTime, 0, -1 do
			InRound.Value = false
			wait(1)
			Status.Value = "inmerssoinTime: ".. i .." Seconds Left!"		
		end
		for i = roundlength, 0, -1 do
			InRound.Value = true
			wait(1)
			Status.Value = "Game: ".. i .." Seconds Left!"
		end
	end
end

spawn(roundTimer)

can your clarify what isn’t working? It’s hard to help debug, with little information.

InRound.Changed:Connect(function()

This will never trigger, since you are not listening to the value change of that instance. You can use InRound.Value.Changed (not recommended) or InRound:GetPropertyChangedSignal() (recommended), but why not wait for the needed amount of players instead of waiting for a value to change?

Thanks I’m going to try it as soon as possible!

And I’m not really sure if the game is going to like a full server and I’m new at scripting

1 Like