Set max draw distance inverted

Is there a way to make an object disappear when it is near a player?