SNPC Clientside Corpses

So my SNPCs have a problem where they will sometimes not spawn their corpse. I will post the video when it’s finished uploading…

Here’s the relevant code snippets from the SNPC.

function ENT:SpawnRagdoll()

  self:Fire( "BecomeRagdoll", "", 0 )


function ENT:DoDeath( dmginfo ) // called after the npc takes damage exceeding its health

if self.Dying then return end

self.Dying = true

self.Entity:SetNPCState( NPC_STATE_DEAD )
//self.Entity:SetSchedule( SCHED_DIE_RAGDOLL ) // this seems to cause problems



BecomeRagdoll() seems to always remove the entity, but not always spawn the ragdoll. Does anyone have any advice or knowledge on this matter?

(User was banned for this post ("Wrong section" - Gran PC))


I guess i could just do self:Remove() serverside and have that run on the client when the entity is removed. I’ll see if it improves anything.