Nice scripts.
I did something similar a while back, SmallG had made a script to make the torch drain and have collectable batteries for the flashlight, and someone requested a collectable flashlight script, so I made one, then decided to work it into SmallG's scripts to make a more complete setc, you can find it at:
https://forum.game-guru.com/thread/214886#msg2544112
Quote: "
1. put flashlight3.lua on a not static item (make it always active).
2. put collect_flashlight2.lua on the item you want to collect (make sure it's not static).
3. flashlight_battery.lua goes on the batteries,(make sure the battery is not static).
Job done, it will supress the flashlight until you collect the item.
Press F to use the flashlight once you have collected it, and hold press and hold F to load a battery."
i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.