Portal gun teleport a bit buggy

So I am currently trying to make a portal gun and all is going well, however after I make the first set of portals the teleport stops working.
Example here:


So pretty much what ends up by happening is on the first set of portals(parts at this point) I am able to teleport from one portal to the other, however after the first set I am no longer able to teleport from one portal to the other

Local script in player scripts:

RS = game:GetService("ReplicatedStorage")
teleport = RS:FindFirstChild("teleport")

local part1 = game.Workspace.Folder:WaitForChild("part1")
local part2 = game.Workspace.Folder:WaitForChild("part2")
local timer = 0
local start1 = true
local start2 = true

part1.Touched:Connect(function(part)
	local Player = part.parent
	
	if start1 == true then
		start2 = false
		start1 = false
		Player.HumanoidRootPart.CFrame = part2.CFrame
		for timer = 3, 0, -1 do
			if timer == 0 then
				start2 = true
				start1 = true
			end
			wait(1)
		end
	end
end)

part2.Touched:Connect(function(part)
	local Player = part.parent
	
	if start2 == true then
		start2 = false
		start1 = false
			Player.HumanoidRootPart.CFrame = part1.CFrame
		for timer = 3, 0, -1 do
			if timer == 0 then
				start2 = true
				start1 = true
			end
			wait(1)
		end
	end
end)

Server Script:

local Replicate = game:GetService("ReplicatedStorage")
local teleport = Replicate:FindFirstChild("teleport")
local partCreate = Replicate:FindFirstChild("partCreate")

partb1 = true
partb2 = nil

local counter = 0
local part1 = nil
local part2 = nil

local cool = nil		--- Just a placeholder name, I know I should name it something else
local cool2 = nil 	--- Just a placeholder name, I know I should name it something else

partCreate.OnServerEvent:Connect(function(player, mousePos)
	
	if partb1 == true then
		if counter > 1 then
			part1:Destroy()
		end
	    part1 = Instance.new("Part")
		part1.Parent = game.Workspace.Folder
		part1.Name = "part1"
		part1.Anchored = true
		part1.BrickColor = BrickColor.new("Really black")
		part1.CFrame = CFrame.new(mousePos)
		cool = true
		counter += 1
	end
	
	if partb2 == true then
		if counter > 2 then
			part2:Destroy()
		end
		part2 = Instance.new("Part")
		part2.Parent = game.Workspace.Folder
		part2.Name = "part2"
		part2.Anchored = true
		part2.BrickColor = BrickColor.new("Really blue")
		part2.CFrame = CFrame.new(mousePos)
		counter += 1
		cool2 = true
	end
	
	partb1 = not partb1
	partb2 = not partb1

end)

if cool == true and cool2 == true then
	teleport:FireClient(cool, cool2)
end

Now I have tried a few solutions, one of which I assigned part1 and part2 to the parts using a remote event but that gave me the same issue.
And I have also thought about using Coroutines for this but I don’t know how to use them and from what I know about them it seems like there is a better way to go about this.

TLDR: portal teleport isn’t working after the first set of portals, wondering if anyone can help me out here

This is what I could notice. Is this a debounce? Why not add a simple one?

Yes it is, and honestly I have no clue why I did it this way.
I have been working on this project for a while as I took a break because of this problem so I have no clue why I did it like I did, however it still works as intended