Teleporter Glitch

I have used multiple scripts and every time, when I use a teleport block, it teleports me above the block. how do I fix this?

local Teleport = "Outside" --Put the name of the Part between the ""s.
function Touch(hit) --Indicates that the Part has been Touched.
	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 --Checks Debounce.
		local Pos = script.Parent.Parent:findFirstChild(Teleport) --Gets the Part to teleport to.
		hit.Parent:moveTo(Pos.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false end end --Takes you there and Ends the Function.
script.Parent.Touched:connect(Touch) --Listens out for Touchers.
3 Likes

What do you mean by “above the block”. Is it supposed to teleport a player inside a part?

robloxapp-20201210-1831266.wmv (2.2 MB)

as you can see, players can glitch outside of the map, why does it do this!!

I think you have to put MoveTo() instead of moveTo(), or perhaps you need to lower the part’s position, like this:

local Teleport = "Outside" --Put the name of the Part between the ""s.
function Touch(hit) --Indicates that the Part has been Touched.
	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) --Gets the Part to teleport to.
		hit.Parent:MoveTo(Pos.Position - Vector3.new(0, 5, 0))
wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false end end --Takes you there and Ends the Function.
script.Parent.Touched:connect(Touch) --Listens out for Touchers.

Did not work, Is there another way to do a Tp?

I found another way. You might have to change the cframe of the humanoidrootpart. (Edited)

local Teleport = "Outside" --Put the name of the Part between the ""s.
function Touch(hit) --Indicates that the Part has been Touched.
	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) --Gets the Part to teleport to.
		hit.Parent.HumanoidRootPart.CFrame = CFrame.new(Teleport.Position)
wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false end end --Takes you there and Ends the Function.
script.Parent.Touched:connect(Touch) --Listens out for Touchers.

this time it didnt even teleport

script.Parent.Touched:Connect(function(hit)
	local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if Player then
		local Character = hit.Parent
		local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
		if HumanoidRootPart then
			HumanoidRootPart.CFrame = Pos.CFrame
		end
	end
end)

Use character:SetPrimaryPartCFrame(cframe here) instead of HumanoidRootPart.CFrame. Not sure if it changes anything though.

1 Like