Hello. So I’m trying to make a trip wire where when someone walks onto it they trip (ragdoll)
They ragdoll just fine but for some reason they float into the air as well.
Here is the script:
script.Parent.Touched:Connect(function(hit)
local character = hit.Parent
local humanoid = character:WaitForChild("Humanoid")
humanoid.BreakJointsOnDeath = false
humanoid.RequiresNeck=false
humanoid:ChangeState(Enum.HumanoidStateType.Physics)
for _, v in pairs(character:GetDescendants()) do
if v:IsA("Motor6D") then
local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
a0.CFrame = v.C0
a1.CFrame = v.C1
a0.Parent = v.Part0
a1.Parent = v.Part1
local b = Instance.new("BallSocketConstraint")
b.Attachment0 = a0
b.Attachment1 = a1
b.Parent = v.Part0
v.Enabled = false
end
end
wait(1)
for _,v in pairs(character:GetDescendants()) do
if v:IsA('Motor6D') then
v.Enabled = true
end
if v.Name == 'BallSocketConstraint' then
v:Destroy()
end
if v.Name == 'Attachment' then
v:Destroy()
end
end
wait(1)
humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
end)
Original Script credit goes to @tonyredgraveX
Thanks!