RB-004
Roblox teleport pad script
Two pads: stand on one and you appear on the other.
- Script type
- Script
- Where it goes
- Inside each pad Part
- Category
- Hazards and pads
For your own game in Roblox Studio. Not for use in other people's games.
The code
-- Teleport pad. Use one copy of this Script in each of the two pads.
-- Pad A has TARGET_NAME = "PadB". Pad B has TARGET_NAME = "PadA".
local TARGET_NAME = "PadB" -- name of the OTHER pad (it must be in the Workspace)
local COOLDOWN = 3 -- seconds before the same player can teleport again
local EXTRA_HEIGHT = 3 -- studs above the target pad to land
local Players = game:GetService("Players")
local pad = script.Parent
local target = workspace:WaitForChild(TARGET_NAME)
pad.Touched:Connect(function(hit)
local character = hit.Parent
local player = Players:GetPlayerFromCharacter(character)
if not player then
return
end
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid or humanoid.Health <= 0 then
return
end
-- The cooldown is saved on the player, so both pads share it.
-- This stops you being sent straight back when you land.
local blockedUntil = player:GetAttribute("TeleportBlockedUntil") or 0
if os.clock() < blockedUntil then
return
end
player:SetAttribute("TeleportBlockedUntil", os.clock() + COOLDOWN)
character:PivotTo(target.CFrame + Vector3.new(0, target.Size.Y / 2 + EXTRA_HEIGHT, 0))
end)How to set it up
- Insert two Parts in the Workspace. Rename one to PadA and the other to PadB.
- Add a Script inside PadA. Paste the code and set TARGET_NAME to "PadB".
- Add a Script inside PadB. Paste the same code and set TARGET_NAME to "PadA".
- Play. Walk onto PadA and you should land on PadB.
Change it
- For a one-way pad, only put the Script in the pad you enter from.
- The names are case sensitive. PadB and padb are different.
- If the pad is not directly in the Workspace (for example inside a Model), change workspace:WaitForChild to the right path.
- Raise EXTRA_HEIGHT if players get stuck in the target pad.
More in Hazards and pads
More Roblox tools
- Shirt and pants templatesFree Roblox clothing templates to download: hoodies, jerseys, jeans, joggers and more.
- Robux tax calculatorWork out what you receive after the marketplace fee, or what to charge.
- Robux to USD calculatorConvert earned Robux to dollars at a DevEx rate you can edit.
- Shirt and pants template makerColour each panel of the 585×559 clothing template and download it.
- Username generatorGenerate usernames that fit the 3–20 character rule.