Posted 22 January 2020 - 08:23 PM
Hey,
I bet this is super simple but i can't make it work :/
https://pastebin.com/cbuigeru
The program works fine as long as their is something in all the 3 tanks being checked.
however if one is emty, then it gets a attemted to index a nill value error.
i tried to fix this whith this:
i also tried forcing tank2.contents.amount and tank3.contents.amount to always be 0 or correct, but this failed also.
(I did not write inn anything to happen yet, if it the value was nil, since this did not work)
Any tips in how to make this work?
(also i am going to add local to evryting wend it works, also sry for bad English )
Thanks
I bet this is super simple but i can't make it work :/
https://pastebin.com/cbuigeru
The program works fine as long as their is something in all the 3 tanks being checked.
however if one is emty, then it gets a attemted to index a nill value error.
i tried to fix this whith this:
- if tank3.contents.amount == nil then
- print("nil")
- end
i also tried forcing tank2.contents.amount and tank3.contents.amount to always be 0 or correct, but this failed also.
(I did not write inn anything to happen yet, if it the value was nil, since this did not work)
Any tips in how to make this work?
(also i am going to add local to evryting wend it works, also sry for bad English )
Thanks