Trying to noclide player and ent

So I am trying to make it nocolide to players, so players can go right through it.

I tried this:



function ENT:ShouldCollide( ent1, ent2 )

	if IsValid(ent1) and ent1:GetClass() == 'thrown_ghoster' and ent2:IsPlayer() then return false end -- Also tried to return true, but same thing.
	return true

end


and its not nocoliding. Please help.

GM:ShouldCollide
Its not an entity hook, its a gamemode hook

To be specific, do not do GM:ShouldCollide(), use a hook.Add instead like so:



hook.Add("ShouldCollide", "EntityCollision", function( ent1, ent2 )

	if IsValid(ent1) and ent1:GetClass() == 'thrown_ghoster' and ent2:IsPlayer() then return false end
	return true

end)


This should work.