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

How do you a teleportation script to an obstacle course?

Asked by 3 years ago

It's really my first time doing scripting and I am really curious on how to make a teleportation script.

1 answer

Log in to vote
0
Answered by 3 years ago
local part = script.Parent

part.Touched:Connect(function(player)
    if player.Parent:FindFirstChild("HumanoidRootPart") then
        local hum = player.Parent:FindFirstChild("HumanoidRootPart")
        if hum then
            wait(0.25)
            hum.CFrame = part.Parent.B.CFrame*CFrame.new(0,2,0
            wait(2)
        end
    end
end)

Here's a script where you touch a part then teleport on top of the second part. The thing to remember is that when moving a player always use "HumanoidRootPart" so that the whole humanoid of the player will be teleported.

Ad

Answer this question