I have made a script with two conditions that need to be fulfilled before doing something. I have tried everything bt it is not working. There are no syntax errors now and I disable/enable every time I save scripts just to be sure.
The script reads a value from a illumination sensor and status from a light object. Then it compares the two and writes to the same light object. Here it is:
I have made a script with two conditions that need to be fulfilled before doing something. I have tried everything bt it is not working. There are no syntax errors now and I disable/enable every time I save scripts just to be sure.
The script reads a value from a illumination sensor and status from a light object. Then it compares the two and writes to the same light object. Here it is:
11.03.2018, 10:59 (This post was last modified: 11.03.2018, 11:00 by 02dag.)
(11.03.2018, 00:21)buuuudzik Wrote:
(11.03.2018, 00:04)02dag Wrote: Hi,
I have made a script with two conditions that need to be fulfilled before doing something. I have tried everything bt it is not working. There are no syntax errors now and I disable/enable every time I save scripts just to be sure.
The script reads a value from a illumination sensor and status from a light object. Then it compares the two and writes to the same light object. Here it is:
Thank you very much. This worked, but I am puzzled. I thought that you could use both 0/1 or /true/false for things like this? Never thought of the latter for this script though.
I have made a script with two conditions that need to be fulfilled before doing something. I have tried everything bt it is not working. There are no syntax errors now and I disable/enable every time I save scripts just to be sure.
The script reads a value from a illumination sensor and status from a light object. Then it compares the two and writes to the same light object. Here it is:
Thank you very much. This worked, but I am puzzled. I thought that you could use both 0/1 or /true/false for things like this? Never thought of the latter for this script though.
You can check that type(false) is 'boolean' and type(0) is 'number'. If you aren't sure of type of variable you can use toboolean function. Check this: