How do i make a bullet explode on impact with a wall or player, not a turret

You can use a print string to get the name, like this:

125684-hiteventdisplayhit.png