Script to remove props.


I want a script, to remove props, when they hit my trigger_multiple.
I already have a script to kill people, with a special steamID, but, I need to make it for props.
local ignore = {‘STEAM_0:1:20219592’, ‘STEAM_0:1:30742789’} local ply = TRIGGER_PLAYER if !table.HasValue(ignore, ply:SteamID()) then ply:Kill() end

I want a script, that if a PROP hits this trigger, it deletes. Anyone who can make this?


local ent = ACTIVATOR if ent:GetClass() == “prop_physics” then ent:Remove() end


untested but should remove any “prop_physics” that hit it, you could do it the same way as for players if you want to remove more than one class of entity. like:


local kill = { ‘prop_physics’, ‘gmod_thruster’ } local ent = ACTIVATOR if table.HasValue(kill, ent:GetClass()) then ent:Remove() end


What I generally do is just make a function in lua and call it from trigger entities. hope this helps.

Is it prop-only? so can people carry entities trought the trigger?

[editline]9th January 2011[/editline]

Shouldn’t it be prop_physics?

[editline]9th January 2011[/editline]

Nvm. It’s working, lol.

[editline]9th January 2011[/editline]

And entities go trough :smiley:

yea, like I was saying I didn’t test it, good that it’s working though.
The first way should only kill prop_physics, the second way you can list what to kill.

I only want prop_physics.
Wait… What’s the name for a camera? I want no spy camera’s in my secret hole D:

Fantym420, not prop physics,gmod thruster but prop_physics,gmod_thruster

SiPlus, don’t whine.
It’s working, how he gave it me.

I want a script, that removed all the entities, EXCEPT for (example) “ruben_head”, “ruben_head1”, etc.

it is prop_physics and gmod_thruster, it’s the lua tag it cuts off the last blank line and it appears to cut off the underscore, however if you copy and paste it is still there.

Can anyone make me the script I asked for?

here ya go, this should remove anything except what is in the list.

local dontkill = { ‘ruben_head’, ‘ruben_head1’ } local ent = ACTIVATOR if !table.HasValue(dontkill, ent:GetClass()) then ent:Remove() end

–This line is to stop the lua tag from cutting off the bottom pixels of the code.

Should kill anything not listed in the table { ‘ruben_head’, ‘ruben_head1’ } and you can just add more to the list if you like { ‘ruben_head’, ‘ruben_head1’, ‘player’, ‘gmod_thruster’ }

Wait, Do I have to add ‘player’? I think player can’t be removed?

if it’s not in the list it will try and remove it

But, how to remove a PLAYER? o.O