RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Write an R15 ragdoll death script while keeping the original player together"
-- server script local function onCharacterAdded(character) local humanoid = character:WaitForChild("Humanoid") local function onDied() local joints = {} for _, part in ipairs(character:GetChildren()) do if part:IsA("BasePart") then for _, joint in ipairs(part:GetChildren()) do if joint:IsA("JointInstance") then table.insert(joints, joint) joint:Destroy() end end end end wait(2) -- ragdoll time -- restore joints for _, joint in ipairs(joints) do joint.Parent = joint.Part0 end -- respawn character character:Destroy() game.Players:GetPlayerFromCharacter(character):LoadCharacter() end humanoid.Died:Connect(onDied) end game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(onCharacterAdded) if player.Character then onCharacterAdded(player.Character) end end)