I’ve been trying to fix this for a while now but nothing seemed to work, it’s really strange.
when the ragdoll is applied to a dummy (owned by the server), the dummy seems to actually get ragdolled but never gets up. when the client ragdolls it’s own character the hrp and the torso fall out but the rest of the limbs stay in the air as if they are anchored (they aren’t)
if anyone has a solution for this i’d appreciate help ![]()
![]()
footage:
the code (it’s shared by both the server and client)
local function ToggleRagdoll(Victim: Model, State: boolean)
local Humanoid = Victim:FindFirstChildOfClass("Humanoid")
if State then
if Humanoid then
Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
Humanoid.AutoRotate = false
end
else
if Humanoid then
Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
Humanoid.AutoRotate = true
end
end
for _, Object: Instance in Victim:GetDescendants() do
if IsLimb(Object) then
if not Object:GetAttribute("OriginalCollide") then
Object:SetAttribute("OriginalCollide", Object.CanCollide)
end
if State then
Object.CanCollide = true
else
Object.CanCollide = Object:GetAttribute("OriginalCollide")
end
end
if Object:IsA("Motor6D") then
if Object.Name == "RootJoint" then
continue
end
local Ballsocket = Object.Part0:FindFirstChild(`RagdollSocket_{Object.Part1}_{Object.Part0}`)
if not Ballsocket then
Ballsocket = Instance.new("BallSocketConstraint")
Ballsocket.Name = `RagdollSocket_{Object.Part1}_{Object.Part0}`
Ballsocket.Parent = Object.Part0
end
local Attach1 = Object.Part0:FindFirstChild(`{Object}_Att1`)
local Attach2 = Object.Part1:FindFirstChild(`{Object}_Att2`)
if not Attach1 or not Attach2 then
Attach1 = Instance.new("Attachment")
Attach2 = Instance.new("Attachment")
Attach1.Name = `{Object.Name}_Att1`
Attach2.Name = `{Object.Name}_Att2`
Attach1.CFrame = Object.C0
Attach2.CFrame = Object.C1
Attach1.Parent = Object.Part0
Attach2.Parent = Object.Part1
end
Ballsocket.Attachment0 = Attach1
Ballsocket.Attachment1 = Attach2
Ballsocket.LimitsEnabled = true
Ballsocket.TwistLimitsEnabled = true
Ballsocket.Enabled = State
Object.Enabled = not State
end
end
end
module.RagdollCharacter = function(Victim: Model, Duration: number)
ToggleRagdoll(Victim, true)
task.delay(Duration, function()
ToggleRagdoll(Victim, false)
end)
end