So basically, i want to remove all the weapons and items that are on a map (being the default hl2 ones like battery and such) when the map loads.
how would one do this?
[LUA]
hook.Add("InitPostEntity", "REMOVEALLTHESTUFF", function()
local weps = { baby_cannon=true, baby_cannon2=true } //Add the weapons class here just like these examples
for k,v in pairs(ents.GetAll())do
if(weps[v:GetClass()])then
v:Remove()
end
end
end)
[/LUA]
hook.Add("InitPostEntity", "RemoveStuff", function()
for k,v in pairs (ents.GetAll()) do
if v:IsWeapon() then v:Remove() end
end
end)
Thanks all.
Sorry, you need to Log In to post a reply to this thread.