SNPC Ragdoll on Death

Does anyone know how to make a snpc ragdoll when it dies? I looked at the code from Dan’s npcs, but it dosn’t work very well.