How to stop an event after visiting a town

Hello!

Basically, my current map looks like this:
y5gTGVw


I want to make it so you can't leave through the top exit until you go into the town. currently, when you try to leave without going to the town, I have an event where the actors say we should visit the town first. After they visit the town, how would I replace that event with one that transfers players to the next map?

Thanks!
I would recommend looking into how switches work. Here's a great video that really helped me understand them.

Anyway, when the player enters the town, turn on a switch. Call it "entered town" or whatever you'd like.

Then open up the event that's on the top exit of your map you posted. Make a new page via the "new event page" button at the top. On this second page, check off "switch" on the left, select the "entered town" switch, and then make your transfer event. This will make it so the player can only go to the next map when that switch is turned on.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-stop-an-event-after-visiting-a-town.110352/