Remove map props?

So I own a darkrp server and this map I use has a lot of annoying props that spawn. Is there any way to remove these props from the map? Ive seen other servers do it but have no idea how to do it, Can someone show me how to do this? thanks!

You might wanna search over the board

So ive used this:

local blacklist = {
[“prop_physics”] = true,
[“prop_whatever”] = true,
}

hook.Add( “InitPostEntity”, “wat”, function()
for _, ent in pairs( ents.GetAll() ) do
if blacklist[ ent:GetClass() ] then ent:Remove() end
end
end )

it cleared a lot of props on the map but theres still a microwave, any idea how to remove everything?

There are many prop types, prop_dynamic, prop_detail, prop_static, check out the full list on the valve wiki and add the appropriate one to your blacklist

So uh i revised my little code here i saw on facepunch to this:

local blacklist = {
[“prop_physics”] = true,
[“prop_detail”] = true,
[“prop_static”] = true,
[“prop_dynamic”] = true,
[“prop_ragdoll”] = true,
[“prop_whatever”] = true,
}

hook.Add( “InitPostEntity”, “wat”, function()
for _, ent in pairs( ents.GetAll() ) do
if blacklist[ ent:GetClass() ] then ent:Remove() end
end
end )

and uh, the darn microwave still is there

Try this:
Go up to the microwave and look directly at it so the middle of your screen is on the microwave, then run this clientside using lua_run_cl or whatever:



local trace = LocalPlayer():GetEyeTrace()
local ent = trace.Entity
print(ent:GetClass())


That should give you the entity’s class so you can add it to the list…unless it’s an actual part of the map or something

[editline]14th February 2016[/editline]

If that doesn’t actually return an entity, try doing



PrintTable( trace )


There are some keys in that table that can tell you if it’s part of the world or not

im confused, where do i enter this info?

You could just do it in the console- type



sv_allowcslua 1


And then type


lua_run_cl print(LocalPlayer():GetEyeTrace().Entity:GetClass())

It’s just a thing you could do for debugging-you don’t need to put it in a file somewhere or anything

this did the trick! no more pesky microwave! thanks! <3