Locked npc random movement in area

Is there a to make npc stop moving if they go in to a area?
You can use Events that activate on event touch: If another event moves onto that tile they activate a switch that stops that other event from moving.

If you don't want the event to move into that region at all, you could use a plugin, like Yanfly's Region restrictions.

Original thread: https://forums.rpgmakerweb.com/threads/locked-npc-random-movement-in-area.141947/