MV Yanfly's Event Chase Player Question

I'm using Yanfly's Event Chase Player plugin. Works great. Wanted to see if anyone knew a specific script I could use but wasn't sure of the coding.

In the plugin parameters, you can choose whether the event has to see the player or not to chase them. There's also scripting you can add within the movement route to turn this on/off per event:

this._seePlayer = true Requires the event to be able to see player.
this._seePlayer = false Doesn't require event to be able to see player.

What I'd like to do in my game is have this turn on/off based on whether a switch is on/off. Players have a flashlight. When it's on... I have a switch active. I then turn that switch off when players turn off their flashlight.

Is there a way for me to write a script that has the "seePlayer" check to see if a switch is on first? If on... seePlayer = false. If off... seePlayer = true
this._seePlayer = $gameSwitches.value(x);

where x is the ID of the switch you want to use.

If the the switch is on, it will be true, else it will be false.
Thank you! This works great 🙂

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/yanflys-event-chase-player-question.147619/