Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a teleportation script?

Asked by
Dera32 0
10 years ago

I followed the teleport service guide on the wiki correctly, but when I touch the teleport, it doesn't do anything.

0
Could you provide your script? We can't really figure out your problem without seeing it. TofuBytes 500 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

If you mean stepping on a brick, then teleporting one place to another, then;

local Tele1 = game.Workspace:WaitForChild("Teleporter1") --Waits for Teleporter1 (Switch out with the name of the teleport you want the player to teleport to Teleporter2 when Teleporter1 is touched
local Tele2 = game.Workspace:WaitForChild("Teleporter2") --Waits for Teleporter2 (Switch out with the name of the teleport you want the player to teleport to
local Debounce = false --The debounce for the script

if Tele1 and Tele2 then --If script finds Teleporter1 and Teleporter2 then
Tele1.Touched:connect(function(hit) --Teleporter1 is touched
if hit.Parent:FindFirstChild("Torso") and not Debounce then --If script finds Torso within the Player's Character and Debounce is false then
Debounce = true --Debounce is now true
hit.Parent.Torso.CFrame = CFrame.new(Tele2.Position + Vector3.new(0,3,0)) --Teleports Player to Teleporter2
wait(2) --Waits two before Debounce is false again
Debounce = false --Debounce is false again
end --The end for the 'if' that which checks for Torso and if Debounce is false 
end) --The end for the Touched event
end --The end for the first 'if' statement

Hope this helped!

0
I think it's to teleport to a different game type of teleport. He brought up TeleportService. TofuBytes 500 — 10y
Ad

Answer this question