Anti "Flop" for Server NPCs

I have NPCs in my game that can be ragdolled, and it works great aside from an occasional “flopping” issue I’ve had upon getting up.

I have fixed this issue for PLAYERS by using the following code in the StarterCharacter (Local script)

local hum = script.Parent:WaitForChild("Humanoid")
hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
hum:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)

However, if I use the same code for a Server NPC in a regular server Script, this solution does not work, causing them to still flop when ragdolled. You can see the flop towards the end of the video.


image
image

I’ve tried different solutions, such as using the StateChanged function and manual changing their state to “GettingUp” when one of the aforementioned states is triggered, but it hasn’t worked.

I’ve also looked around, and nobody else can seem to find a solid solution for this issue.

This is a huge problem (for me), especially with more complex NPCs (they spin around uncontrollably and glitch), that I can’t seem to find a fix for.

Any reason as to why this wouldn’t work? Is there a more robust solution I can use instead that completely disables the ragdoll/knocked over state that happens?