what is the script to check if player interacted with this event?

i have a parallel event that is a pet that does certain actions checking if condition is met then do this. However I want the player to pet it if they interact with it. Therefore I need the script call to check if player interacted with this event then do _______.

I know i need to do conditional branch ---> script --> if player interacted with this event
but i don't know the script call for it. Help?
You can just toggle a control switch when you interact with it then check that control switch
Thank you for the reply, but I can't interact with it because it is a parallel event. It looks like this
1747020610863.png

The event will just run the code in it constantly which is why I need a conditional branch in it that says if player interacts with me, then play petting animation. I just don't know how rpg maker by default does the code to check when a player interacts with the event that has the default trigger "action button" instead of parallel, then run the code for the event because the player interacted with it.

In my case, I want the sheep to follow you and then stand still and if you go too far away from it then it starts running to catch up which I already coded, but I need to make this a parallel event to do this. I might also want to make it so that if it sees a monster then it runs away, so I can't just use the approach movement type.

Because of the custom movement, I need to do a script call in the parallel event that checks if player interacted with it, then you can do something like pet it because if I put the petting animation within this current parallel event then it would do the petting animation every 5 frames which is why I need the if statement for on player interacted with this. I just don't know the script call for how rpg maker detects if player interacts with an event
there is no such script because the player is not supposed to interact with a parallel process that way.

what is usually done is to split the event - have one parallel process without a sprite control the movement of the second event, allowing the second event to have an action button trigger to react to interactions.
or use the autonomous movement that is automatically in parallel, although I don't know if your specific code can be handled by an autonomous move route.
Copy and paste that event page into a parallel common event and replace the 0 in the this.character(0) with the event number. That will free up the event's page and let it be an action trigger instead of a parallel. The parallel common event will then be remotely controlling the event.
I will do that then. Thank you both

Original thread: https://forums.rpgmakerweb.com/threads/what-is-the-script-to-check-if-player-interacted-with-this-event.177603/