How to make a zone the player can't walk through but enemies can

Thanks for setting me in the right direction.