RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Create an R15 death script that causes the player to ragdoll upon death."
-- local script inside StarterPlayerScripts local Players = game:GetService("Players") local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local function ragdoll(character) for _, joint in pairs(character:GetDescendants()) do if joint:IsA("Motor6D") then local attachment0 = Instance.new("Attachment", joint.Part0) local attachment1 = Instance.new("Attachment", joint.Part1) attachment0.Name, attachment1.Name = "RagdollAttachment0", "RagdollAttachment1" local ballSocket = Instance.new("BallSocketConstraint") ballSocket.Attachment0, ballSocket.Attachment1 = attachment0, attachment1 ballSocket.Parent = character end end end local function onCharacterAdded(character) humanoid = character:WaitForChild("Humanoid") humanoid.Died:Connect(function() ragdoll(character) end) end if character then onCharacterAdded(character) end player.CharacterAdded:Connect(onCharacterAdded)