Make NPC humanoid unable to be ragdoll

I’m trying to make boss NPC using humanoid, but it gets ragdoll on fight, which hides boss and gets very glitchy.
I tried to block it using Humanoid:SetStateEnabled() but it seems like it works in only client and players.

How can I block NPC to be ragdoll?