Making an event follow another event

So I'm trying to make one event move randomly, and be followed by another event.

Shouldn't be too hard and i guess it would be something along the line of:

Event 1:
Move Route -> Script -> Put a random number from 0 to 3 in a variable
Move Route -> Script -> Move in the direction defined by that variable

Event 2:
Move Route -> Script -> Move in the direction defined by that variable

But i don't have enough knowledge of the rpg maker mz script to write those functions myself. Anyone can help?
mo, can't work that way.
the problem would start when both events are on the end of a wall and the first event can go left but the second event not because the wall is there.

the second event can't always go in the same direction, it would have to go to the place the first event occupied before the move.

and even then you don't need that much scripts.
just set the autonomous movement of the first event to random, never using set move route.

as for the second event the better solution is to add a pathfinding plugin/script and then use that script to follow the first event.
mo, can't work that way.
the problem would start when both events are on the end of a wall and the first event can go left but the second event not because the wall is there.

the second event can't always go in the same direction, it would have to go to the place the first event occupied before the move.

and even then you don't need that much scripts.
just set the autonomous movement of the first event to random, never using set move route.

as for the second event the better solution is to add a pathfinding plugin/script and then use that script to follow the first event.
That make sense!

Do you have a link to a pathfinding script?
I hope this helps, there's a spot for one event following another event.
Scripting Move Routes

Original thread: https://forums.rpgmakerweb.com/threads/making-an-event-follow-another-event.171582/