|
| 06 Feb 2014 05:59 PM |
I'm trying to make a script that updates a value which is read by pointlights in the map so that they're never too bright or dull but I keep returning an error on line five that I'm trying to compare a boolean value with a number value. I understand what the error means but I'm not referencing any boolean values.
Any help is appreciated.
local value = script.Parent.brightness.Value local minutes = Game.Lighting
while true do if 0 < (minutes:GetMinutesAfterMidnight()) <= 480 then value = 1 -- 8 elseif 480 < (minutes:GetMinutesAfterMidnight()) <= 540 then value = 0.9 -- 9 elseif 540 < (minutes:GetMinutesAfterMidnight()) <= 600 then value = 0.7 -- 10 elseif 600 < (minutes:GetMinutesAfterMidnight()) <= 660 then value = 0.4 -- 11 elseif 660 < (minutes:GetMinutesAfterMidnight()) <= 720 then value = 0.2 -- 12 elseif 720 < (minutes:GetMinutesAfterMidnight()) <= 780 then value = 0 -- 1 elseif 780 < (minutes:GetMinutesAfterMidnight()) <= 840 then value = 0 -- 2 elseif 840 < (minutes:GetMinutesAfterMidnight()) <= 900 then value = 0.1 -- 3 elseif 900 < (minutes:GetMinutesAfterMidnight()) <= 960 then value = 0.2 -- 4 elseif 960 < (minutes:GetMinutesAfterMidnight()) <= 1020 then value = 0.4 -- 5 elseif 1020 < (minutes:GetMinutesAfterMidnight()) <= 1080 then value = 0.6 -- 6 elseif 1080 < (minutes:GetMinutesAfterMidnight()) <= 1140 then value = 0.7 --7 elseif 1140 < (minutes:GetMinutesAfterMidnight()) <= 1200 then value = 0.8 --8 elseif 1200 < (minutes:GetMinutesAfterMidnight()) <= 1260 then value = 0.9 -- 9 elseif 1260 < (minutes:GetMinutesAfterMidnight()) <= 1440 then value = 1 -- 10 - 12 wait(1) end |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 05:59 PM |
| The "local brightness = script.Parent.brightness.Value" is a number value. |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 06:08 PM |
| local minutes = game:GetService("Lighting").TimeOfDay |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 06:10 PM |
| Is there any other way? The idea of using the minutes after midnight was so that ir would return a number value rather than the value of the time. |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 06:12 PM |
| How can you get the value of the tomeofday without actually indexing timeofday... |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 06:14 PM |
| The time of day changes in a separate script, this is the script responsible for retrieving the minutes after midnight and updating a value called brightness that is read by the pointlights. |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 06:15 PM |
| Yes, but your original line indexed minutes as lighting, not the time |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 06:17 PM |
| This script doesn't need to grab time, it needs to grab how far past midnight the game is, unless I'm completely misunderstanding what you're saying. |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 06:19 PM |
| I apoligize, I misunderstood the way that method worked. |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 06:22 PM |
| any idea why studio thinks I'm referencing a boolean? |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 06:24 PM |
| I believe you need ands to check if something is greater than everything else. |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 06:37 PM |
| still not got a bloody idea on how to do it, if nobody responds in the next fifteen minutes I'll probably just leave it and take a fresh look in the morning. |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 06:39 PM |
if minutes:GetMinutesAfterMidnight() > 0 and minutes:GetMinutesAfterMidnight() <= 480 then value = 1
follow this model |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Feb 2014 06:42 PM |
| Why thank you. If ya want to send me a friend request, send it to my main, domorox17 |
|
|
| Report Abuse |
|
|