Protection from possessed props in TTT.

Hi there. I’ve been running a garry’s mod server for a couple weeks now, by default it’s TTT. I’ve been searching around for propkill protection scripts for a while now but they typically disable prop damage entirely. All I want to do is disable damage dealt by props possessed by spectators. I have the gravity gun (and of course the poltergeist) on my server so I’d rather not disable prop damage outright. This is the script I tried to use. I basically copied it from a script in another thread and modified it to try and check for the networked entity linked to the prop.


function Antipropkill(target, inflictor )
	if target:IsPlayer() and inflictor:GetNWEntity("spec_owner", nil) 
		return false
	else
		return true
	end
end
hook.Add("PlayerShouldTakeDamage", "Anti PropDamage")

I’ve got it running as an addon, going to lua/autorun/server

Am I on the right track even remotely?

I mean I could just disable prop possession or make it take longer to get punches than I had it, but I really do want to give the specprops plenty of mobility… just without killing the players.