General > Developers Corner
Removing entities in trigger
(1/1)
Moka:
So I have been trying to figure out the code and all I could find is:
--- Code: ---local kill = { 'prop_physics' } local ent = ACTIVATOR if table.HasValue(kill, ent:GetClass()) then ent:Remove() end[/code
I try to switch ACTIVATOR with the name of my trigger in the map but it just seems to error out. Any help would be awesome.
--- End code ---
LuaTenshi:
--- Quote from: Moka on January 31, 2013, 03:12:56 AM ---So I have been trying to figure out the code and all I could find is:
--- Code: ---local kill = { 'prop_physics' } local ent = ACTIVATOR if table.HasValue(kill, ent:GetClass()) then ent:Remove() end[/code
I try to switch ACTIVATOR with the name of my trigger in the map but it just seems to error out. Any help would be awesome.
--- End code ---
--- End quote ---
Why not use some thing like this..
for k,v in pairs(ents.FindInBox(Min,Max)) do if(v:GetClass() == "prop_physics") then ent:Remove() end end
Use this to help you with ents.FindInBox.
That will allow you to get almost the same effect you are looking for and you wont have to use the trigger brush.
Moka:
Thanks man! Been bugging me trying to figure out that code out. Thanks for your help!
Navigation
[0] Message Index
Go to full version