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

Teleporter script has an error?

Asked by 9 years ago

I have 2 teleporters. I just need 1, because they are basically the same thing:

script.Parent.Touched:connect(function(tch)
    local trs = tch.Parent:FindFirstChild("Torso")
    local lrm =  tch.Parent:FindFirstChild("Left Arm")
    local rrm =  tch.Parent:FindFirstChild("Right Arm")
    local lg =  tch.Parent:FindFirstChild("Left Leg")
    local rg =  tch.Parent:FindFirstChild("Right Leg")
    local hd =  tch.Parent:FindFirstChild("Head")
    if trs ~= nil and lrm ~= nil and rrm ~= nil and lg ~= nil and rg ~= nil and hd ~= nil then

        trs.Position = script.Parent.Parent.TP2.Position
        lrm.Position = script.Parent.Parent.TP2.Position
        rrm.Position = script.Parent.Parent.TP2.Position
        lg.Position = script.Parent.Parent.TP2.Position
        rg.Position = script.Parent.Parent.TP2.Position
        hd.Position = script.Parent.Parent.TP2.Position
    end
end)

The problem is that I think the joints disconnect when repositioned and makes the player die.

Is there a good method to make sure the joints don't disconnect and teleport?

1 answer

Log in to vote
0
Answered by 9 years ago

Have you tried using playerModel:MoveTo(position) yet?

0
Not really, because this is my original script. But I can't believe I didn't use that method instead of the one I did. groovydino 2 — 9y
0
Thanks for your answer! I accepted your answer. groovydino 2 — 9y
Ad

Answer this question