Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a teleport script?

how do i make a telepory script please tell me.

1 comment

0

This is a request

3 answers

I didn't know what event you wanted to use so I assume it's the most common event to use when making a Teleporter.

script.Parent.Touched:connect(function(Player)-- Activate the Script whenever an Object touches the Part.
local Humanoid = Player.Parent:FindFirstChild("Humanoid")-- This prevent other object like "Part" from being "CFramed"
if Humanoid then
Player.Torso.CFrame = CFrame.new(x,y,z)-- Replace X,Y,Z with your actual coordinates.
	end
end)

If you want to know about the Functions and Events I used then I suggest going to these links: Parameters Touched CFrame

If you want me to explain anything I wrote in further detail the feel free to leave a comment or too. If I helped you answer your question then I would appreciate it if you good "Accept" my answer.

hmm.. you can also teleport the player to another part! (easier to change)

local PartToTeleportTo = script.Parent.PartToTeleportTo --This Part has to be in A model with this script and the other teleporter!
P = script.Parent

P.Touched:connect(functio(plr)  --this will run the function bellow when script.Parent is Touched
 local Humanoid = plr.Parent:FindFirstChild("Humanoid")    --plr.Parent let the script look to the 
thing that touched the teleporter it's Parent. It will search for an Humanoid
if Humanoid then
	if plr.Parent.Parent.Parent == game.Players  then  --(if broken remove this game.)
		Player.Torso.CFrame = CFrame.new(PartToTeleportTo.Position)
	end
end
end)

Move the torso to the position you want it in

1 comment

0

eg game.Players.LocalPlayer.Character.Torso.Position = CFrame.new(position)--I think

This discussion is preserved as it was. New answers, comments, and votes are closed.