Forja

Roblox teleport script

Touch one part to arrive at another, for doors, portals and shortcuts in the same place.

Where it goes

  1. 1Add a Part where players should arrive, turn on Anchored and name it TeleportTarget.
  2. 2Add the Part they'll touch, turn on Anchored, hover over it in the Explorer, press + and choose Script.
  3. 3Delete what's in the Script, paste this in and press Play.
Teleporter · a Script in the Part players touch
-- From forja.us/tools/roblox-scripts/teleport-- Touch this part to arrive at the part named TeleportTarget.local Players = game:GetService("Players")local part = script.Parentlocal target = workspace:WaitForChild("TeleportTarget")local justTeleported = {}part.Touched:Connect(function(hit)	local character = hit:FindFirstAncestorOfClass("Model")	local player = character and Players:GetPlayerFromCharacter(character)	if not player or justTeleported[player] then		return	end	justTeleported[player] = true	character:PivotTo(target.CFrame + Vector3.new(0, 4, 0))	task.wait(1)	justTeleported[player] = nilend)

How it works

  • GetPlayerFromCharacter makes sure a player touched it, not a loose part.
  • PivotTo moves the whole character at once, 4 studs above the target so they don't land inside it.
  • justTeleported waits a second before that player can use it again, so two parts can face each other without bouncing them back and forth.

Make it yours

Both ways
Copy the Part to the other end, and change the target's name in its Script.
Want something more? The script generator can write it: “A portal that fades the screen to black, teleports the player, and fades back”

Maps to try it on: lobby maps

Start from a finished map, and your scripts have a game to run in.

More free Roblox scripts