I am trying to make a solid object that works just like a normal solid until the player picks up a item. Then it will allow the player to pass through it but nothing else. This way enemies can not follow.
One way would be to make a variable that stores whether the player has the object or not (1 for yes, 0 for no) and make an On-overlap event on the barrier that checks the variable when the player sprite overlap it. If player is determined to have object then move him x number of pixels past, or teleport him to other side via a respawn event. Since the barrier can then stay solid the enemies will never be able to cross.