NPC chasing

How can i make NPC chasing player after player step on the event block. Please help me!!
In the event block set it to Touch trigger and put
$gameSelfSwitches.setValue([mapNumber, NPCidNumber, 'A'], true);

In the NPC make a second event page with self switch A checkbox checked and put in autonomous movement
this.moveStraight(this.findDirectionTo($gamePlayer.x, $gamePlayer.y));
Hi @Jishakami You may want to do a tutorial on switches and parallel processing event triggers.

@AquaEcho showed you how to do it easily with script calls. You can also do it with built-in rpg maker event commands.

It will work like this:
1) player steps on event block and that turns on a switch
2) you have another event with a parallel process trigger and the above switch ticked. This parallel process event will use set movement route for the NPC to step toward player.
Hi @Jishakami You may want to do a tutorial on switches and parallel processing event triggers.

@AquaEcho showed you how to do it easily with script calls. You can also do it with built-in rpg maker event commands.

It will work like this:
1) player steps on event block and that turns on a switch
2) you have another event with a parallel process trigger and the above switch ticked. This parallel process event will use set movement route for the NPC to step toward player.
thank u to your tips

Original thread: https://forums.rpgmakerweb.com/threads/npc-chasing.159369/