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

Why is part freezing in place once it gets welded to the player's lower leg or foot?

Asked by 6 years ago

I have been making a game that requires players to wear a full body suit that gets welded to their body. I made a script & everything works fine until I get to any of the parts that are meant to be welded to the players lower legs, whenever one of them gets welded it just freezes on the players leg & stops them from moving. I used the same script on every part, the only difference is the target parts so I don't know why these ones aren't working.

Here is the code:

01script.Parent.Touched:Connect(function(hit)
02    humanoid = hit.Parent:findFirstChild("Humanoid")
03    if humanoid then
04        if script.Parent:FindFirstChild("weld") == nil then
05            rightLowerLeg = hit.Parent.RightLowerLeg
06            script.Parent.CFrame = rightLowerLeg.CFrame * CFrame.new(0, -0.3155, 0)
07            weld = Instance.new("Weld")
08            weld.Part0 = rightLowerLeg
09            weld.C0 = rightLowerLeg.CFrame:Inverse()
10            weld.Part1 = script.Parent
11            weld.C1 = script.Parent.CFrame:Inverse()
12            weld.Parent = script.Parent
13            weld.Parent.Anchored = false
14        end
15    end
16end)

I have also tried welding them to the player's foot but it still does the same thing. I have made sure that it isn't anchored before AND after the script has run.

1 answer

Log in to vote
0
Answered by 6 years ago

Nvm I just remade the part & it worked.

Ad

Answer this question