Enemies react to random timed sounds?

Im trying to make a bit in my game where the player has to sneak past enemies before a sound goes off (not sure what it’ll be yet) and if the player is in close proximity to the enemy when the sound goes off, this alerts the enemy and makes them chase after the player.

Does anyone know how this could be done?
Vlue's Proximity Events will work here.

How it works is that you make enemies into parallel processing events and then put conditional branches into their code that have the following script:

Proxy.inprox_d?(@event_id,5,true)

The 5 is the amount of tiles they see, the "true" is the cone of sight priority.

Then you make a parallel processing event that isn't an enemy NPC and have it also tagged with a proximity conditional branch (Proxy.inprox?(@event_id,3,true)) that checks if the player is next to the enemy when the sound goes off.

This will get more intensive the more parallel processing events you have, so tag all of them with like 10-15 frames of wait below the conditional branches.
Actually, to get an almost precise idea on when the SE finishes, you'd need to know the exact time it takes to be played in milliseconds. Use an internal timer to see if it has reached zero.
Vlue's Proximity Events will work here.

How it works is that you make enemies into parallel processing events and then put conditional branches into their code that have the following script:

Proxy.inprox_d?(@event_id,5,true)

The 5 is the amount of tiles they see, the "true" is the cone of sight priority.

Then you make a parallel processing event that isn't an enemy NPC and have it also tagged with a proximity conditional branch (Proxy.inprox?(@event_id,3,true)) that checks if the player is next to the enemy when the sound goes off.

This will get more intensive the more parallel processing events you have, so tag all of them with like 10-15 frames of wait below the conditional branches
Forgive me, but I’m not entirely sure how this script works. Do I just copy and paste it into the script editor, or do I paste it in an event? Could someone kind of inform me how that works? Thank you!
Forgive me, but I’m not entirely sure how this script works. Do I just copy and paste it into the script editor, or do I paste it in an event? Could someone kind of inform me how that works? Thank you!

You have to install the script.

And then follow the instructions I clearly listed in my original post here.
Vlue's Proximity Events will work here.

How it works is that you make enemies into parallel processing events and then put conditional branches into their code that have the following script:

Proxy.inprox_d?(@event_id,5,true)

The 5 is the amount of tiles they see, the "true" is the cone of sight priority.

Then you make a parallel processing event that isn't an enemy NPC and have it also tagged with a proximity conditional branch (Proxy.inprox?(@event_id,3,true)) that checks if the player is next to the enemy when the sound goes off.

This will get more intensive the more parallel processing events you have, so tag all of them with like 10-15 frames of wait below the conditional branches.
Hey! Forgive me for coming back so much later, I have a better understanding of scripts now! Though, I do need a bit of help.

I'm trying to set it up, but I'm not exactly sure how it works. I've put the conditional branches in both the enemy's event and the separate parallel process event. I know I'm missing something, but I'm not sure what! The enemy won't come to the player when the sound plays!

Original thread: https://forums.rpgmakerweb.com/threads/enemies-react-to-random-timed-sounds.154759/