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.
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 self.Entity:SpawnRagdoll()
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))