I am trying to make it show round and intermission times, but when another person is playing the game, the game bugs out and both the intermission and round timer keep coming up

local function LoopThrough(TimeGui, Seconds, Format)
	for i = Seconds, 0, -1 do
		local IntermissionFormat = string.format(Format, i)
		TimeGui.Frame.TextLabel.Text = IntermissionFormat
		wait(1)
	end
end

while true do
	local Restart = game.ReplicatedStorage.Restart
	local Teleport = game.ReplicatedStorage.Teleport
	local GameEnded = game.ReplicatedStorage.GameEnded
	for i,v in ipairs(game.Players:GetPlayers()) do
		local TimeGui = v.PlayerGui:FindFirstChild('TimeGui')
		if TimeGui then
			LoopThrough(TimeGui, 10, "Intermission: %s")
			Teleport:Fire()
			LoopThrough(TimeGui, 20, "Round: %s")
			Restart:Fire()
			GameEnded:Fire()
		end
	end
	wait()
end