so I made this basic ralldoll engine that if you die you turn into a ralldoll but i wan the ralldoll to fling when the player dies heres the script
game.Players.PlayerAdded:Connect(function(p) p.CharacterAdded:Connect(function(c) c.Humanoid.BreakJointsOnDeath = false c.Humanoid.Died:Connect(function() for _, v in pairs(c:GetDescendants()) do if v:IsA("Motor6D") then local logic0, logic21 = Instance.new("Attachment"), Instance.new("Attachment") logic0.CFrame = v.C0 logic21.CFrame = v.C1 logic0.Parent = v.Part0 logic21.Parent = v.Part1 local logic1 = Instance.new("BallSocketConstraint") logic1.Attachment0 = a0 logic1.Attachment1 = a1 logic1.Parent = v.Parent v:Destroy() end end c.HumanoidRootPart.CanCollide = false end) end) end)
I would use a VectorForce like this
game.Players.PlayerAdded:Connect(function(p) p.CharacterAdded:Connect(function(c) c.Humanoid.BreakJointsOnDeath = false c.Humanoid.Died:Connect(function() for _, v in pairs(c:GetDescendants()) do if v:IsA("Motor6D") then local logic0, logic21 = Instance.new("Attachment"), Instance.new("Attachment") logic0.CFrame = v.C0 logic21.CFrame = v.C1 logic0.Parent = v.Part0 logic21.Parent = v.Part1 local logic1 = Instance.new("BallSocketConstraint") logic1.Attachment0 = logic0 logic1.Attachment1 = logic21 logic1.Parent = v.Parent v:Destroy() end end c.HumanoidRootPart.CanCollide = false local hrp = c.HumanoidRootPart local rootAttachment = hrp.RootAttachment local force = Instance.new("VectorForce", hrp) force.Attachment0 = rootAttachment force.Force = Vector3.new(math.random(-100, 100), 0, 500) end) end) end)