How i can "touch" entity with "weapon" collision?



function ENT:Initialize()
 
	self:SetModel( "models/props_junk/watermelon01.mdl" )
	self:SetMoveType( MOVETYPE_VPHYSICS )   -- after all, gmod is a physics
	self:SetSolid( SOLID_VPHYSICS )         -- Toolbox
        self:SetCollisionGroup( COLLISION_GROUP_WEAPON )
	
        local phys = self:GetPhysicsObject()
	if (phys:IsValid()) then
		phys:Wake()
	end
end
 
function ENT:Touch( col )
	
	if not (IsValid(col) and col:IsPlayer()) then return end
    
	self:EmitSound("items/smallmedkit1.wav")
	
	self:Remove()

end


As you see it has Collision Group “COLLISION_GROUP_WEAPON” and when i touch it nothing happends. I just walk through it.
How i can do same effect when i can walk through it but touch function will work?

Check here for ENUMS: https://wiki.garrysmod.com/page/Enums/COLLISION_GROUP perhaps “COLLISION_GROUP_DEBRIS_TRIGGER”

I’ve tried. It’s not woking :c

I’m not sure if it’d work if you’ll want collisions with other stuff, but I remember either Entity:SetSolid(SOLID_NONE) or Entity:SetTrigger(true) or both allow Touch to run even if it’s not solid.

SetSolid (SOLID_NONE) is not working .-.
SetTrigger(true) is working but it can do “touch” event more than 1 time (as i need “give points”)

[editline]27th January 2017[/editline]

Should i just create local bool like “PickedUp” and when player touch trigger it will set “true” like this

Would it work correctly?

[editline]27th January 2017[/editline]

But thank you anyway. Will work on that.

if touch being triggered multiple times is a problem then use ENT:StartTouch ()