Scripts / Belidos flashlight with battery

Author
Message
thatandplaygames
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location: In a creative space
Posted: 16th Mar 2021 19:30
Hello,
I got the scripts here:

https://forum.game-guru.com/thread/214886#msg2544112

Everything works fine except collecting the battery.
When I go near the battery to collect I get an error:
"scriptbank\Belidos\FlashLightBattery\flashlight_battery.lua:21: attempt to compare nil with number"

Instructions:

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."

------------------



smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Mar 2021 20:46
flashlight_batteries_txt doesn't exist so set it at the top of the script
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
thatandplaygames
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location: In a creative space
Posted: 17th Mar 2021 14:02
So put this at the top?

flashlight_batteries_txt=1

Thanks smallg!
thatandplaygames
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location: In a creative space
Posted: 17th Mar 2021 14:08
Adding:
flashlight_batteries_txt = 1
to flashlight_battery.lua works but when I press F it goes from 100% > 0% and then back to 100% and the battery I collected is still 1.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 17th Mar 2021 17:09
to fix the above you need to make flashlight_batteries_txt match the actual amount of the batteries (or remove it and just use that variable in it's place)

did you try my new version? it might fit your needs better
https://forum.game-guru.com/thread/207801?page=26#msg2634886

lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 21st Mar 2021 16:06
Quote: "to fix the above you need to make flashlight_batteries_txt match the actual amount of the batteries (or remove it and just use that variable in it's place)

did you try my new version? it might fit your needs better
https://forum.game-guru.com/thread/207801?page=26#msg2634886"


THE NEW VERSION WORKS WITH ggc TOO?
PC 1 Specs:
AMD RYZEN 3800x OPTA CORE @3,90, 64GB RAM DDR4 @3200,
M/B GIGABYTE AX370, SVGA ATI XFX RX580 GTS XXX EDITION 8GB GDDR5 , 1X SSD M.2 TRANSCEND S110 1TB, 1X SSD SAMGUNG EVO QVO 870 1TB SATA3 ,1X HDD SEAGATE BARRACUDA 4TB, 1X HDD TOSHIBA 2TB



PC 2 Specs:
AMD QUADCORE 880K @4.5GHZ, 32GB RAM DDR3 1600, M/B ASUS A88XM-PLUS
SVGA RADEON R9 380 4GB , SSD KINGSTON A400 1TB, 2X HHD SEAGATE BARRACUDA 4TB
PM

Login to post a reply

Server time is: 2024-04-23 09:57:54
Your offset time is: 2024-04-23 09:57:54