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 4 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 4 years ago
01local part = script.Parent
02 
03part.Touched:Connect(function(player)
04    if player.Parent:FindFirstChild("HumanoidRootPart") then
05        local hum = player.Parent:FindFirstChild("HumanoidRootPart")
06        if hum then
07            wait(0.25)
08            hum.CFrame = part.Parent.B.CFrame*CFrame.new(0,2,0
09            wait(2)
10        end
11    end
12end)

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