RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Can you write a script that causes players to ragdoll upon death using R15?"
-- server script local function ragdoll(character) for _, joint in ipairs(character:GetDescendants()) do if joint:IsA("Motor6D") then local ballsocket = Instance.new("BallSocketConstraint") ballsocket.Parent = character ballsocket.Attachment0 = joint.Part0:FindFirstChild("RagdollAttachment") or joint.Part0:FindFirstChildOfClass("Attachment") ballsocket.Attachment1 = joint.Part1:FindFirstChild("RagdollAttachment") or joint.Part1:FindFirstChildOfClass("Attachment") joint:Destroy() end end end local function onCharacterAdded(character) character:WaitForChild("Humanoid").Died:Connect(function() ragdoll(character) end) end game.Players.PlayerAdded:Connect(function(player) if player.Character then onCharacterAdded(player.Character) end player.CharacterAdded:Connect(onCharacterAdded) end)