How Do I Make This Script Stop Giving Me Time When The TouchEnded?

script.Parent.Touched:Connect(function(hit)
while wait(1) do
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr.leaderstats.Time.Value += plr.leaderstats.Rebirths.Value
end
end)

script.Parent.TouchEnded:Connect(function()

end)

local db = false
script.Parent.Touched:Connect(function(hit)
	db = false
	while db == false do
		wait(1)
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		plr.leaderstats.Time.Value += plr.leaderstats.Rebirths.Value
	end
end)

script.Parent.TouchEnded:Connect(function()
	db = true
end)