Author Topic: Removing entities in trigger  (Read 2077 times)

0 Members and 1 Guest are viewing this topic.

Offline Moka

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Removing entities in trigger
« 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: [Select]
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.

Offline LuaTenshi

  • Hero Member
  • *****
  • Posts: 545
  • Karma: 47
  • Just your ordinary moon angel!
    • Mirai.Red
Re: Removing entities in trigger
« Reply #1 on: January 31, 2013, 06:24:32 AM »
So I have been trying to figure out the code and all I could find is:
Code: [Select]
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.

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.
« Last Edit: January 31, 2013, 10:09:24 AM by HeLLFox_15 »
I cry every time I see that I am not a respected member of this community.

Offline Moka

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: Removing entities in trigger
« Reply #2 on: February 01, 2013, 03:38:38 PM »
Thanks man! Been bugging me trying to figure out that code out. Thanks for your help!