Anti-propkill

Hello!

I’ve spent the last two hours or so trying to find anti-propkill/proppush scripts with no luck.

Would any of you know of some and be kind enough to tell me how to install it?

Thanks!

For Anti prop push, You need to prevent the prop from coliding with players whilst the other player is moving it. Once he was let go of the prop, you will also have to check if the prop is stuck in a player.

For anti proppush, just reset the prop’s velocity once the player has let go.

I’m not at all an experience lua coder.

Would these two scripts work?


local AMS = {}
function AMS.PropDamage( target, inflictor )
	if target:IsPlayer() and inflictor:GetClass() == "prop_physics" or inflictor:GetClass() == "prop_dynamic" then
		return false
	else
		return true
	end
end
hook.Add("PlayerShouldTakeDamage", "Anti PropDamage", AMS.PropDamage)


function AMS.PropKill( ply, ent )
	if not IsValid(ent) then return end

	ent:SetPos(ent:GetPos())
end
hook.Add("PhysgunDrop", "Anti PropKill", AMS.PropKill)

If so, where would I throw them?

[editline]16th October 2013[/editline]

Another question, what about preventing vehicles from driving and killing you?

Put it in lua/autorun/



hook.Add("EntityTakeDamage", "AntiPropKill", function( target, dmginfo )
local attacker = dmginfo:GetAttacker()

if attacker:GetClass() == "prop_physics" then
dmginfo:SetDamage(0)
end

end)


Can anyone confirm if the above solution works?

vegasx’s solution just turns off damage from props.