Detect Cone in front of Player

I'm creating a game where the player carries a flashlight. I want to have things react to the flashlight being shined on them, but I'm not sure how to do that. I assume it would involve using JavaScript, detecting a cone (at least, the squares necessary to make something cone-like) in front of the player, and... something happens. Certain actors will take damage, items may appear, etc.

I know I managed something of the sort on VX Ace years ago, but that was a completely different language. Any help on figuring this out would be appreciated.
depends on how your flashlight works, there are several ways to do this.

Unfortunately we can't help you because you mixed up things in your post:
You posted in VX, are talking about VX Ace - which both use variants of RGSS as script and have absolutely nothing to do with Javascript, which is the language of MV.

Please tell us which maker you're using, report your topic so a mod can move it into the correct folder and perhaps set your profile to display the maker you're using.
Oh shoot. I meant to post in MV. Sorry about that.

Original thread: https://forums.rpgmakerweb.com/threads/detect-cone-in-front-of-player.103365/