• limit ragdolls
    4 replies, posted
scrublord question: i need a way to limit the amount of dead NPC's can exist on my server at any given time, as it focuses on killing zombies the first 5 minutes start out fine then the corpses pile up and start to lagg my server out. i have already tried limiting them in the .cfg files but that didnt work (i didn't really expect it to). i cant even use "clean up" every so often, as the only thing that clears the dead NPC's is clean up everything. that gets rid of players stuff and map entities. getting rid of the copses entirely or making them fade away almost isntantly would also be fine. how can this be done?
"clean up" has options to clean up only NPCs/ragdolls, try that.
[QUOTE=RonanZer0;46164907]"clean up" has options to clean up only NPCs/ragdolls, try that.[/QUOTE] i did try both of those and only "clean up everything" works. i think its because they spawn on the map rather than having a player spawn them in.
[QUOTE=Fantym420;28872958]This was way was shown to me when I was working on a game mode a while back, place in a client side file, like cl_init.lua if you're making a game mode or for single player sandbox put in garrysmod\lua\autorun\client\removerags.lua [lua] 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,0) end end end hook.Add("OnEntityCreated", "RemoveDeadRag", RemoveDeadRag) [/lua] NOTE: Never remove anything from the client that's not client side only, if you removed a prop_ragdoll it would crash you off server with a missing entity if it's still exists on the server.[/QUOTE] This should still work.
[QUOTE=Tomelyr;46165307]This should still work.[/QUOTE] Exactly what i wanted, thanks a million.
Sorry, you need to Log In to post a reply to this thread.