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

How To Make A Teleport Script? [closed]

Asked by 10 years ago

This question already has an answer here:

How do we move a whole model?

Please Explain How To make This Script...

Marked as Duplicate by User#2

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?

2 answers

Log in to vote
1
Answered by
Damo999 182
10 years ago

first you would insert a brick and then insert a script into that brick. Once done you would need to create an ontouched function that changes your character torso cframe to your new desired cframe here is an exmaple.

brick = script.Parent --this is just the scripts parent which would be the Part you inserted.
player = game.Players.LocalPlayer --put this inside of a local script

brick.Touched:connect(function()
    player.Character.Torso.CFrame = CFrame.new(10,0,0)
end)



Ad
Log in to vote
1
Answered by 10 years ago
function onTouch(part) --This is the function you got to use
    local p = part.Parent:FindFirstChild("Humanoid") --Finds theplayer and save's it as a tag to later use
    if p then --Checks if the part that we tagged is ingame
        p.CFrame = CFrame.new(1,1,1) --Teleports it to that postition, you can change the position
    end
end

script.Parent.Touched:connect(onTouch) --Connects it and makes it work
0
Humanoid's don't have a CFrame property. User#2 0 — 10y