Artificial intelligence

I need some help with the artificial intelligence. In my game, there are some people walking in a specific pattern. I want to make a person stop when he see the player, have a baloon icon and load the game over screen. I know how to do this last three things, the thing that i don't know is: how can i make the event start when the player is seen by the NPC? 

I'm not so good at english, so i attached a file to make you understand better.

Screenshot (6).png
maybe use this plugin?

http://forums.rpgmakerweb.com/index.php?/topic/48715-sensor-selfswitch/
I can't download it. My antivirus reveals it as a malware.
Is there another metod?
gallo101, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.

If you want to add something, use the Edit button (bottom right, near the MultiQuote button) and add it to your last post.

However, the link takes you to a plugin for MV, and you need a script for Ace.  Try searching the Master Script list for Stealth scripts.  These are specifically designed to initiate actions when an NPC sees the player.  Alternatively, there is a tutorial showing you how to do this with events.  Search the Ace Tutorial forum, again looking for Stealth.

Oh, and as a side point, referring to this as 'Artificial Intelligence' might be a bit confusing, as usually that refers to actions in battle e.g. setting up skill use patterns.

Original thread: https://forums.rpgmakerweb.com/threads/artificial-intelligence.52964/