HumanoidStateType Continuously Overridden

I am making a ragdoll script for NPCs where I set their HumanoidStateType to Physics/Ragdoll. However, even when I manually disable all other state-types, the HumanoidStateType continuously defaults to “Running” when I apply a BodyVelocity to the HRP.

Here is the part of the script where I change the HumanoidStateTypes:

function HitHandler.Knockback(humrp: Part, name: string, maxForce: number, direction: Vector3, force: number, duration: number)
	warn(humrp.Parent.Humanoid:GetState())
	humrp.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Running, false)
	humrp.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.RunningNoPhysics, false)
	humrp.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
	humrp.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Freefall, false)
	humrp.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
	humrp.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
	humrp.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)
	humrp.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Flying, false)
	humrp.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Landed, false)
	humrp.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.StrafingNoPhysics, false)
	humrp.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, false)
	KnockHandler.Move(humrp.Parent.Humanoid, 5000, 10, direction, 0.2, "Moving")
end

Originally I only set the Enum.HumanoidStateType.Running to false, however this didn’t work so I basically raged and tried setting every humanoid state type except for Physics/Ragdoll to false.

Needless to say, the HumanoidStateType continues to say “Running” despite it literally being disabled. This is in a server-sided module script.

I need to know how to keep this from happening. Why is this being overriden, and how do I stop it?

1 Like

Try turning ON the PlatformStand state as well when the player is ragdolled. PlatformStand prevents the player from “getting up” after ragdolling, and the player getting back up could be why it always default to the Running state.

Just remember to turn off PlatformStand when you want the player to actually get back up

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.