Path Blocking Guard

I want my NPC to block my characters from passing by him. A sort of "Do Not Cross This Line" thing which ultimately stops the player from reaching the treasure behind the NPC's "Line"

I need the NPC to move WITH the player so that they may onlly pass his lin if they choose to battle him.

Any help would be much appreciated! 🙂
So a single NPC blocking an area several tiles wide? Normally I'd just put several events across and not have the NPC move at all (or really, I'd use a wide event script).

You could TRY something like this in the autonomous move route, and set the NPC event's speed to 4 (to match the player's) or to 5 (to be a little bit faster than the player's):

If it's a horizontal line:

Script: move_straight(4) if $game_player.x < @xScript: move_straight(6) if $game_player.x > @xif it's a vertical line:
Code:
Script: move_straight(8) if $game_player.y < @yScript: move_straight(2) if $game_player.y > @y
This simply tells the event to move right or left (or up or down) so be in the same x or y position as the player.You might also want to check the Direction Fix button to make the NPC always face the player.

Then you can still keep the trigger to Action Button and add the battle command to the event list.
You could also do the ad-hoc solution of blocking off all but one tile of space for the players to go through. That would work quite well, could do this by putting plants on either side of the guard. This will work provided you are not talking about a really huge room or corridor.
Im using the script to give the NPC a somewhat cocky feel. No more more gtting past mr buff guy! XD

The single tile option was my original go to but the script has worked wonders for me!

Thank you kindly! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/path-blocking-guard.37941/