Scripts / Hood for "flashlight with batteries from Smallg"

Author
Message
Sergg
8
Years of Service
User Offline
Joined: 25th Aug 2015
Location:
Posted: 9th Jan 2016 10:10
Hi! I tried to make hood for flashlight , but I could not . Gives an error message. Please help!

Original script :


My script :
PM
wermer
8
Years of Service
User Offline
Joined: 18th Sep 2015
Location:
Posted: 10th Jan 2016 20:18
I think you are trying to make a HUD to show the remaining battery life. The main problem I see is that you are trying to access a table(array) as a normal variable.

if flashlight_battery_life > 70 then <----WRONG

if flashlight_battery_life[current_battery] > 70 <----CORRECT

This code does nothing:

'flashlight_batteries_life' is not initialized so it's nul, and its never referenced again.

This looks like typo:


I've never tried small's flashlight script, but I think your idea should work fine.



Windows 10 Home 64-bit / Intel i5 2500k @ 4.4Ghz + Asetek 510LC / Intel DP67DE / Intel 530 Series 240GB SSD / 12GB Kingston KVR 1333 / XFX Radeon R9 285 / Corsair TX 650 / Antec 300
PM
Sergg
8
Years of Service
User Offline
Joined: 25th Aug 2015
Location:
Posted: 10th Jan 2016 21:05
Quote: "I think you are trying to make a HUD to show the remaining battery life. The main problem I see is that you are trying to access a table(array) as a normal variable.

if flashlight_battery_life > 70 then <----WRONG

if flashlight_battery_life[current_battery] > 70 <----CORRECT

This code does nothing:
+ Code Snippet

'flashlight_batteries_life' is not initialized so it's nul, and its never referenced again.

This looks like typo:
+ Code Snippet


I've never tried small's flashlight script, but I think your idea should work fine."


Thank you! Everything worked!
PM

Login to post a reply

Server time is: 2024-04-28 02:25:50
Your offset time is: 2024-04-28 02:25:50