Anti prop kill

The request is on the title, i got a server RP and some player use prop to kill people.

Thanks for the answer.

humm, no idea?


(User was banned for this post ("Bumpity bump" - mahalis))

You mean like a system that kills anyone who prop kills? I’m not a coder but I’m sure it’s possible. I’ve seen something like it.

No, like someone can’t be hurt by a prop.

[lua]
hook.Add(“EntityTakeDamage”,“NoKillerProps”,function(ent,i,a)
if(ent:IsPlayer()&(i:GetClass()==“prop_physics”|a:GetClass()==“prop_physics”) then
return false
end
end)
[/lua]
Untested. Wasn’t sure if inflicter was the prop or attacker was the prop, so I made it work for both just in-case.
This would belong in
lua/autorun/server
folder.

Refer to:
**[Gamemode.EntityTakeDamage

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Gamemode.EntityTakeDamage)**

I mean, like when someone take a prop with a phys gun the prop go ghost and if you shoot it, its still ghost, so it dont hurt anyone

Here:

[lua]
function AntiPropPushPickup( userid, ent )
if ent:GetClass() == “prop_physics” then
ent:SetCollisionGroup( COLLISION_GROUP_WEAPON )
local r,g,b,a = ent:GetColor();
ent:SetColor(r,g,b,100)
end
end
hook.Add( “PhysgunPickup”, “AntiPropPushPickup”, AntiPropPushPickup )

function AntiPropPushDrop( pl, ent )
if ent:GetClass() == “prop_physics” then
ent:GetPhysicsObject():SetVelocity( Vector(0,0,0) )
ent:GetPhysicsObject():AddAngleVelocity(ent:GetPhysicsObject():GetAngleVelocity( )*-1)
ent:SetCollisionGroup( COLLISION_GROUP_NONE )
local r,g,b,a = ent:GetColor();
ent:SetColor(r,g,b,255)
end
end
hook.Add(“PhysgunDrop”, “AntiPropPushDrop”, AntiPropPushDrop);

function AntiPropPushFreezing(weapon, physobj, ent, ply)
if ent:GetClass() == “prop_physics” then
local rad = ent:BoundingRadius()*1.3
local inside = false
for k, ply in pairs(player.GetAll()) do
if (ply:GetPos():Distance(ent:LocalToWorld(ent:OBBCenter())) < rad) then
inside = true
end
end
for k, ply in pairs(player.GetAll()) do
local pos = ply:GetPos() + Vector(0,0,64)
if (pos:Distance(ent:LocalToWorld(ent:OBBCenter())) < rad) then
inside = true
end
end

    if inside then  
        ent:SetCollisionGroup( COLLISION_GROUP_WEAPON )  
        local r,g,b,a = ent:GetColor();  
        ent:SetColor(r,g,b,100)  
    else  
        ent:SetCollisionGroup( COLLISION_GROUP_NONE )  
        local r,g,b,a = ent:GetColor();  
        ent:SetColor(r,g,b,255)  
    end   
end  

end
hook.Add(“OnPhysgunFreeze”, “AntiPropPushFreezing”, AntiPropPushFreezing)

function AntiPropKill(victim, attacker)
if(not attacker:IsPlayer()) then
if (attacker:GetClass() == “prop_physics”) then
return false
end
end
end

hook.Add( “PlayerShouldTakeDamage”, “AntiPropKill”, AntiPropKill)
[/lua]
Cant remember who made it (Found it in the old DarkRP thread some time ago.)

I added it to lua/autorun/server but its not working. You know why?

Falco’s prop protection has a prop ghost for anti prop kill/push

I tryed falcon prop protection, but its like fucking all my config, and when i activate the anti prop kill, its just do 0 damage when they get hurted by a prop and it prop push.

This script work realy good, but it dont detect who touching the object, so everyone, when they touch a object it changing to ghost and its not his own object. Someone know why?