Event triggering when going near them

I'm trying to make a quest where you have to follow an npc as they move through the city, but you cannot be too close to them.
To clarify... the Event will play parallel as it goes from point A to B to C and we just can't be within 5 or so tiles of them. Other than that, we can just do whatever as the Event plays.
I'm trying to figure out how to make that work, but I seem to be missing something.
Does anyone know how to get this working in base RPG-MZ or what plugin would help here?
This seems to do what you say.

Alternatively, you can have a paralell event that constantly checks the distance between the player and said npc.
So get 2 Variables for the event.

"Event X"
"Event Y"

Set it to a parallel event ad set the "Event X" to the X pos of the NPC, and same for the "Event Y", the Y Pos of the NPC.


then do another Variables for the player's X and Y pos.

Then do a conditional branch where if the X and or Y Pos of Event is = or less the players X/Y's pos then trigger alert switch or something like that.


It may require some tuning to do but that's the idea if you don't want to use plugins.
This seems to do what you say.

Alternatively, you can have a paralell event that constantly checks the distance between the player and said npc.
That seems like a plugin I can understand 🙂
Thanks for the suggestion.

Original thread: https://forums.rpgmakerweb.com/threads/event-triggering-when-going-near-them.174466/