Dissapearing corpses.

I occasionally do silly NPC wars of a sort, or sometimes making home-made zombie defence ( No lua coding , just putting npc spawners all over the place and scattering weapons around the map that i have to scavange to find ) But when I do these wars / zombe survivals, It ends up lagging massively in a short amount of time because the corpses don’t DISAPPEAR in a decent time causing there to be a huge corpse build up … And huge lag.

Now, At first I thought this would be relatively simple for a lua coder ( I know no LUA… ) But then I kind of thought about it and it MIGHT be a bit difficult.

Basically what i am looking for is a addon that I could enable to EITHER make the corpses dissapear at a set time , OR have a function where If i type in a command in the console all the corpses would Dissapear.

I appreciate anyone who puts a effort into this! My steam ID: [JG]Nubcaek1337[{TSTA}]

[lua]if SERVER then return end – Make sure this is client only.
function CleanUpClientRagdolls()
for k,v in ipairs(ents.GetAll()) do
if v:GetClass()==“class C_ClientRagdoll” then
v:Remove()
end
end
end
concommand.Add(“CleanUpClientRagdolls”,CleanUpClientRagdolls)
timer.Create(“CleanUpClientRagdolls”,300,0,CleanUpClientRagdolls)[/lua]
Place in garrysmod/lua/autorun/client/cleanupcorpses.lua

Please forgive me , I’m noob at all of this x.x
C:\Program Files\Steam\steamapps
ubcaek1337\garrysmod\garrysmod\lua
Is this the correct address? I look in my LUA folder and All I can find is ‘includes’ ‘postprocess’ and ‘vgui’ folders. There is no Autorun :frowning: I know i’m probably just looking in the wrong spot :C Thanks for your help so far, though!

That is the correct place, just make the autorun and client folders.

Thank you very much this helps alot guys O: