Teleporters teleporting player when touching any unanchored part after tping

  1. What do you want to achieve? I want a working teleport script that teleports you to the part its paired with, so you can teleport back and forth between them

  2. What is the issue? I’m able to teleport back and forth between the tpers, but immediately after teleporting if I touch any unanchored part in a certain timeframe (im not sure why) I teleport back to the teleporter i came back from

  3. What solutions have you tried so far? increasing debounce time, lowering debounce time, checking for scripts inside unanchored parts (but it seems to work for all of them

heres the script of one of the teleporters.
the teleporter its paired with has the exact same script but the Teleport variable at the top is changed.

local Teleport = "Teleport2" 	
	local humanoid = hit.Parent:FindFirstChild("Humanoid")

	if humanoid then

		if script.Parent.Locked == false and script.Parent.Parent:findFirstChild(Teleport).Locked == false then
			script.Parent.Locked = true 
			script.Parent.Parent:findFirstChild(Teleport).Locked = true

			local Pos = script.Parent.Parent:findFirstChild(Teleport)
			script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false 

example video of the problem.
note: the part i touched that teleported me back was a random unanchored part i just created

Maybe disable the script for a certain amount of time (then re-enabling it). Honestly I don’t know what could be causing that bug. Lemme know if disabling the script worked for you.

nope it didnt work, but im just gonna remake the entire teleport script and see how it goes

1 Like

Alright well good luck with that :+1:

1 Like

soo for some reason this code works

local nametp2 = "Teleport2"
local TeleportPart2 = script.Parent.Parent:WaitForChild(nametp2)
local TeleportPart1 = script.Parent

	local hrp = hit.Parent:FindFirstChild("HumanoidRootPart")
	if hrp then
		hrp.CFrame = TeleportPart2.CFrame +, 5, 0)
		TeleportPart2.CanTouch = false
		TeleportPart2.CanTouch = true

idk i dont even get why it does, but whatever i dont have the problem anymore
for the off chance someone else runs into this here it is.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.