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

How do I make a door teleport you to another door?

Asked by
Prekzz 0
2 years ago

I need help making a script that teleports you from point A to point B upon touching the part, followed by an opening door animation.

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

Inside the door write this:

script.Parent.Touched:Connect(function(hit)
    if game.Players:GetPlayerFromCharacter(hit.Parent)then
        local RootPart = hit.Parent:FindFirstChild("HumanoidRootPart")

        RootPart.CFrame = CFrame.new(0, 0, 0) --Here put the position of the part you want to be teleported to

    end

end)
0
About the door opening animation, you could use a hinge that acts as a center of rotation, to do this you could use CFrame. Here is a link to read more about it: https://developer.roblox.com/en-us/articles/CFrame-Math-Operations Shadic1270 136 — 2y
Ad

Answer this question