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

How can i make a successful ragdoll system?

Asked by 4 years ago

I'm trying to make a ragdoll system that whenever I click it turns me into a ragdoll. Only problem is that it's not. It might be that I'm doing it R6 but I'm not very sure. If you could help me that would be very appreciated.

Server Script

game.ReplicatedStorage.StaminaRem.ARemote.OnServerEvent:Connect(function(Player)
    local char = Player.Character or Player.CharacterAdded:Wait()
    local d = char:GetDescendants()
    for i=1,#d do
        local desc = d[i]
        if desc:IsA("Motor6D") then
            local socket = Instance.new("BallSocketConstraint")
            local part0 = desc.Part0
            local joint_name = desc.Name
            local attachment0 = desc.Parent:FindFirstChild(joint_name.."Attachment") or desc.Parent:FindFirstChild(joint_name.."RigAttachment")
            local attachment1 = part0:FindFirstChild(joint_name.."Attachment") or part0:FindFirstChild(joint_name.."RigAttachment")
            if attachment0 and attachment1 then
                socket.Attachment0, socket.Attachment1 = attachment0, attachment1
                socket.Parent = desc.Parent
                desc:Destroy()
            end 
        end
    end
end)

Don't worry about whats in the local script,

Regards, Bl_ueHistory

0
Any errors? BashGuy10 384 — 4y
1
Also, if you could send me the local script, i can help more. BashGuy10 384 — 4y
0
The local script is really just a FireServer() only used to grab the player. Thats why i said not to worry about it Bl_ueHistory 94 — 4y

Answer this question