Using 'Touch' in a SWEP between a player and entity

Yeah I know its in the Entity library but I figured I would give it a shot. I am trying to have a weapon where I PrimaryAttack and the prop (I use a trace) will print something each time it gets touched by a player. Also another issue I ran into was using the ‘in pairs’ loop and comparing the table “types” against ‘prop:GetClass’ but I could never get it to return true but thats minor.



function SWEP:PrimaryAttack()
	-- Compatable prop types
	local types = { "prop_physics", "prop_dynamic", "prop_physics_multiplayer", "prop_dynamic_multiplayer",
	"prop_physics_override", "prop_dynamic_override" }

	local pos = self.Owner:GetShootPos()
	local ang = self.Owner:GetAimVector()
	local tracedata = {}
	tracedata.start = pos
	tracedata.endpos = pos+(ang*2000)
	tracedata.filter = self.Owner
	local trace = util.TraceLine(tracedata)
	
	local prop = trace.Entity
	for k,v in pairs(types) do
		print("The prop you are looking at is a " .. prop:GetClass())
		if ( prop:GetClass() == "prop_physics" and IsValid(prop))then -- I cant get GetClass to compare correctly, fix later. 
			print("Is correct prop")
			prop:SetNWBool("TrapArmed", true) 
		end
	end
end


And then the “experimental” code for Touch that I tried working with is here



hook.Add("Touch", "TrapperTouch", function(ply, prop)
	if SERVER then
		if (ply:IsPlayer() and IsValid(ply) and IsValid(prop))then
			print("Player touch")
			
		end
	end
end) 


Well really my question is how can I use “touch” out of an entity?