How would I make a telaporter?

How would I make a teleporter?

The title speaks for itself.

2 Likes

TeleportService: TeleportService | Roblox Creator Documentation
Teleport the player: PVInstance | Roblox Creator Documentation

1 Like

character:moveto(part), simple.

1 Like

Simple, but PivotTo is superior here.
MoveTo is also slower performance-wise.

1 Like

Hey, My PV isn’t working, When I used the teleporters twice, it moved me off the map / added a bigger value.

script.Parent.Touched:Connect(function(hit)
	local character = hit.Parent.Parent
	local currentPivot = character:GetPivot()

	character:PivotTo(CFrame.new(10.5, 3, -187.5))
end)
1 Like

Then you need to double-check the CFrame.
currentPivot isn’t needed here either, as you aren’t using it.

1 Like

The CFrame is correct, idk why its acting like this at all.

I spawned a few parts and put their CFrame as so, and it did not go to another place.

Works fine for me. So it’s definitely not the PivotTo function’s fault.
You might want to add a Vector3.new() as well, as it will teleport you inside the part if it’s big enough etc.
As in, it ignores collisions as it will always teleport you to the center of the part.

Example: Character:PivotTo(CFrame.new() + Vector3.new(0, 5, 0)) -- X, Y, Z

1 Like

I ended up just finding the players humanoid root part and setting its Vector 3 value to blah blah blah, I did this out of confusion and also because it it easier for me.

local players = game:GetService("Players")

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local hmr = character:WaitForChild("HumanoidRootPart")
		task.wait(5)
		hmr.CFrame = CFrame.new(0, 100, 0)
	end)
end)