Passing lights - Khas' lighting script

Hello everyone.

I'm trying to do a horror game, and I'm using Khas' awesome lighting effects script. I've managed to understand enough of it it to use it (I am not script savvy in the slightest), and I'm trying to make the player pass his lantern over to an npc.

However, I can't find a way to pass it to the npc without the light going out.

Here's the script for the player:

l = $game_map.lantern

l.change_owner($game_player)

l.set_graphic("torch_m")

l.set_opacity(180,30)

l.show

 

And for my npc who is event number 24 on my map

l = $game_map.lantern

l.change_owner($game_map.events[024])

l.set_graphic("torch_m")

l.set_opacity(180,30)

l.show


When I then test it, the light just goes out. Could someone tell me what I'm doing wrong?

Thanks

LNicol90

Original thread: https://forums.rpgmakerweb.com/threads/passing-lights-khas-lighting-script.28239/