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

Ragdoll script making player fly up?

Asked by
Aozwel 71
3 years ago

Hey there, I've been stuck on trying to find a fix for this issue for awhile now and not sure what is causing it to behave this way?

Basically once the player is ragdolled they are getting pulled up as if by force into the air.

Script:

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        local human = char:WaitForChild("Humanoid")
        for _, v in pairs(char: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 ball = Instance.new("BallSocketConstraint")
                ball.Attachment0 = a0
                ball.Attachment1 = a1
                ball.Parent = v.Part0

                char:WaitForChild("Humanoid"):ChangeState(Enum.HumanoidStateType.Physics)
                char.HumanoidRootPart.CanCollide = false
                v.Enabled = false
            end
        end

        wait(10)
        local human = char:WaitForChild("Humanoid")
        for _, v in pairs(char:GetDescendants()) do
            if v:IsA("Motor6D") then
                v.Enabled = true
                char:WaitForChild("Humanoid"):ChangeState(Enum.HumanoidStateType.GettingUp)
            end
        end
    end)
end)

Any help is appreciated!

1 answer

Log in to vote
0
Answered by 3 years ago

Try changing the state types on line 17 and 28

Here's a list of state types that you can test out.

0
Tried all logical ones, Nothing worked. Aozwel 71 — 3y
0
Maybe anchor the HumanoidRootPart, and if needed, the rest of the body parts? LeedleLeeRocket 1257 — 3y
0
That just results in not giving it a ragdoll effect, Does stop the flying tho Aozwel 71 — 3y
0
Add a wait() in between ragdolling the humanoid and freezing it LeedleLeeRocket 1257 — 3y
Ad

Answer this question