There HAS been a topic on this before, but the solution there didn’t help. I’m having the same problem as OP in that topic, I have a ragdoll system, and I can’t set the player’s humanoid state to physics, I’ve tried the code from the solution but it didnt work. It does easily switch the humanoidstate to physics on dummies, but not on a player. Here’s the code:
function injury.ragdoll(bool)
task.spawn(function()
while true do
print(hum:GetState())
wait(0.1)
end
end)
if bool == nil then bool = false end
for index, joint in pairs(script.Parent:GetDescendants()) do
if joint:IsA("Motor6D") then
hum:ChangeState(Enum.HumanoidStateType.Physics)
hum:SetStateEnabled(Enum.HumanoidStateType.Running, false)
socket = Instance.new("BallSocketConstraint")
a1 = Instance.new("Attachment")
a2 = Instance.new("Attachment")
a1.Name = "ragdollat"
a2.Name = "ragdollat"
a1.Parent = joint.Part0
a2.Parent = joint.Part1
socket.Parent = joint.Parent
socket.Attachment0 = a1
socket.Attachment1 = a2
a1.CFrame = joint.C0
a2.CFrame = joint.C1
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
cl = joint:Clone()
cl.Parent = joints
value = Instance.new("StringValue", cl)
value.Name = "jParent"
value.Value = joint.Parent.Name
joint:Destroy()
if bool then
local bv = Instance.new("BodyVelocity")
bv.Parent = script.Parent.Torso
bv.Velocity = Vector3.new(7, 0, 10)
game:GetService("Debris"):AddItem(bv, 0.05)
end
end
end
end
--It always prints Enum.HumanoidState.Running and therefore the ragdoll doesn't work properly