Is it possible to remove all HL2 weapons and items from a map with LUA? Like, SMGs and ammo crates. I know a lot of you are going to say “decomp it and do it yourself” but here it isn’t an option. Any help? Tips? Scripts that already exist?
npc_strider, weapon_smg, etc.
Any way to remove all without making a list of everything you want to remove?
Such as, all things that start with weapon_ or item_ or anything like that?
Oh, sure it’s possible. Give me a sec…
for k, v in pairs ( ents.GetAll() ) do
if ( string.find( v:GetClass(), “weapon_” ) or ( string.find( v:GetClass(), “item_” ) then
hook.Add( “InitPostEntity”, “RemoveStuff”, RemoveThings )
Put this code in a new .lua file in lua/autorun/server.