Issues with Victor Engine Lighting script

(Apologies in advance if this is the wrong forum or has already been answered)

I love this script, but I'm running into a problem when I try to deactivate it. The setup I'm using is pretty simple: A PP event runs the Create Shade event, the player steps on a 'Player Touch' event that turns on a switch which controls the Actor Light event (which is PP). After a few steps, the player steps on another Player Touch event that is supposed to deactivate the light, but all it does is cause the effect to flicker.
Issues1.PNG

issues2.PNG


The script gives a <remove light> script call, but trying to use it gives this error:

issue3.PNG


Any ideas? Everything runs perfectly as far as getting the effect to work, it's trying to turn it off that's giving me problems. I've tried changing the Create Shade event to require a switch to be active, then deactivating the switch to attempt to turn off the Shade event, but this isn't working.
Moved to: RGSSx Script Support
Any ideas?
Fairly easy to fix.
The issue is that both events are parallel process and you do not turn them off.
You should use a self switch for each so when you need to turn them off you can.
So have two pages the second would either be the effect or just blank and the first the opposite.
then when you want to change one use this script command,
$game_self_switches[[map_id, event id, 'self switch']] = true
e.g.
$game_self_switches[[14, 9, 'A']] = true # or false

Original thread: https://forums.rpgmakerweb.com/threads/issues-with-victor-engine-lighting-script.133901/