Help with timer

I have this queue system and everything works fine expect the timer. When the first player enters the queue the timer speed is normal but when more people enter the timer speed gets faster and faster.

This is my main script

local function cancel()
	script.Parent.Time.Value = 40
end

local place1_id = 5545817809

script.Parent.Players.Changed:Connect(function()
	if script.Parent.Players.Value >= 1 then
		repeat
			script.Parent.Time.Value = script.Parent.Time.Value -1
			wait(1)
		until script.Parent.Players.Value < 1 or script.Parent.Time.Value <= 0
		for i,v in pairs(script.Parent.Waiting:GetChildren()) do
			if game.Players:FindFirstChild(v.Name) then
				local plrs = game.Players:FindFirstChild(v.Name)
				local teleportservice = game:GetService("TeleportService")
				teleportservice:Teleport(place1_id,plrs)
				v:Destroy()
				script.Parent.Players.Value = 0
				script.Parent.Part.Script.Disabled = true
				script.Parent.Part.BrickColor = BrickColor.new(0,255,0)
				wait(5)
				script.Parent.Part.Script.Disabled = false
			end
		end
		cancel()
	else
	cancel()
	end
end)

Screenshot_147

That’s because the function duplicates when more players join this server