Humanoid:SetStateEnabled doesn't work

I tried to stop humanoid being ragdoll so I use SetStateEnabled but it didn’t work, I tried to block jump too and it failed too.
adding bodyForce sucessfully worked. but only SetStateEnabled doesn’t work

there was no error, also it’s server sided script

if nogTarget ~= nil then
			for _, v in pairs(nogTarget.Character:GetDescendants()) do
				if v:IsA("BasePart") then
					local bodyForce = Instance.new("BodyForce")
					bodyForce.Force = Vector3.new(0, v:GetMass() * workspace.Gravity, 0)
					bodyForce.Parent = v
				end
			end
			local hmd = nogTarget.Character:FindFirstChildOfClass("Humanoid")
			hmd:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
			hmd:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
		end

You might want to instead try forcing the Humanoid to the GettingUp state if they enter the FallingDown or Ragdoll states. You can use StateChanged to check when the Humanoid’s state changes; if their new state is any of these two, use ChangeState to force the Humanoid to the GettingUp state.

2 Likes