I'm made a part that if touched, it would weld to the torso...but every time I touch it, it would cause me to float in the air and get stuck.
function WeldingTesting(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
local torso = hit.Parent.Torso
local weld = Instance.new("Weld")
weld.Part0 = torso
weld.C0 = torso.CFrame:inverse()
weld.Part1 = script.Parent
weld.C1 = script.Parent.CFrame:inverse()
weld.Parent = script.Parent
script.Parent.CFrame = torso.CFrame * CFrame.new(5,10,5)
script.Parent.Anchored = false
script.Parent.CanCollide = false
end
end
script.Parent.Touched:connect(WeldingTesting)
Please help?

2 comments
Didn't work. I still float in the air. But, thanks for trying.
Edited.