• Removing dead NPC's corpses
    5 replies, posted
Hi! I have tried multiple solutions such as hook.Add("OnEntityCreated", "RemoveDeadRag", function(ent)ifnot (IsValid(ent) and ent:GetClass() == "class C_ClientRagdoll") thenreturnend SafeRemoveEntityDelayed(ent, 1) end) and function RemoveDeadRag( ent )if (ent:GetClass() == "prop_ragdoll") thenif ent:IsValid() and !(ent == NULL) then SafeRemoveEntityDelayed(ent,1) endendend hook.Add("OnEntityCreated", "RemoveDeadRag", RemoveDeadRag) Its either these solutions do not work or I am not putting them in the correct spot (I have tried /lua/autorun/client).
https://pics.me.me/clear-concise-solution-to-a-problem-in-a-forum-thread-18663588.png
alright then /lua/autorun/client function RemoveDeadRag( ent ) if (ent == NULL) or (ent == nil) then return end if (ent:GetClass() == "class C_ClientRagdoll") then  if ent:IsValid() and !(ent == NULL) then SafeRemoveEntityDelayed(ent,3)  end end  end hook.Add("OnEntityCreated", "RemoveDeadRag", RemoveDeadRag)
-- P.S. You dont need the second IF function RemoveDeadRag( ent )   if(ent == NULL) or (ent == nil) then return end   if(ent:GetClass() == "class C_ClientRagdoll") then     SafeRemoveEntityDelayed(ent,3)   end end hook.Add("OnEntityCreated", "RemoveDeadRag", RemoveDeadRag)
Sorry, you need to Log In to post a reply to this thread.