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

How to make a teleport script? [closed]

Asked by
astr01 0
9 years ago

how do i make a telepory script please tell me.

0
This is a request BSIncorporated 640 — 9y

Closed as Not Constructive by AmericanStripes

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

3 answers

Log in to vote
1
Answered by 9 years ago

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.

Ad
Log in to vote
0
Answered by 9 years ago

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)
Log in to vote
-1
Answered by
xuefei123 214 Moderation Voter
9 years ago

Move the torso to the position you want it in

0
eg game.Players.LocalPlayer.Character.Torso.Position = CFrame.new(position)--I think xuefei123 214 — 9y