How to determine hit collision

I should say more accurately it should only receive a hit trigger from one source as opposed to any other, while blocking all else in the world.