|
| 13 Jul 2017 12:38 PM |
| I wrote this day/night cycle script: minutesAfterMidnight = 600 while wait(1) do minutesAfterMidnight = minutesAfterMidnight + 1 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) if game.Lighting.TimeOfDay == ("18:00:00") then game.Lighting.OutdoorAmbient = Color3.new(0,0,0) game.Lighting.Brightness = 0.7 script.Parent.DayLoop:Pause() script.Parent.NightLoop:Play() end if game.Lighting.TimeOfDay == ("6:00:00") then game.Lighting.OutdoorAmbient = ####################### game.Lighting.Brightness = 1 script.Parent.NightLoop:Pause() script.Parent.DayLoop:Play() end end It works fine, except for the second if statement. At six AM, nothing changes. I have no idea what's wrong ,and if anyone could help me that would be great. Thanks! |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2017 12:40 PM |
| minutesAfterMidnight = 600 while wait(1) do minutesAfterMidnight = minutesAfterMidnight + 1 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) if game.Lighting.TimeOfDay == ("18:00:00") then game.Lighting.OutdoorAmbient = Color3.new(0,0,0) game.Lighting.Brightness = 0.7 script.Parent.DayLoop:Pause() script.Parent.NightLoop:Play() end if game.Lighting.TimeOfDay == ("6:00:00") then game.Lighting.OutdoorAmbient = ####################### game.Lighting.Brightness = 1 script.Parent.NightLoop:Pause() script.Parent.DayLoop:Play() end end |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2017 12:41 PM |
I hate Roblox sometimes.
goo.gl/uNvgQB
|
|
|
| Report Abuse |
|
|
| |
|
doggy00
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 3571 |
|
|
| 13 Jul 2017 12:43 PM |
Errors in output?
Also if it keeps censoring it then it's easier to just post it on Pastebin and give us the end of the link. |
|
|
| Report Abuse |
|
|
doggy00
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 3571 |
|
|
| 13 Jul 2017 12:44 PM |
| Or shorten it like that, whatever works :P |
|
|
| Report Abuse |
|
|
doggy00
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 3571 |
|
|
| 13 Jul 2017 12:47 PM |
| This may not work, but maybe setting minutesAfterMidnight to 0 once it reaches 1440 (because that's how many minutes are in a day)? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
doggy00
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 3571 |
|
|
| 13 Jul 2017 10:37 PM |
| Did you try setting minutesAfterMidnight back to 0 like I mentioned above? If that doesn't work then I don't know what's wrong with the script. |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Jul 2017 10:44 PM |
Put 'minutesAfterMidnight = minutesAfterMidnight + 1' after 'game.LIghting:SetMinutesAfterMidnight(minutesAfterMidnight)
--Jon_TheDev |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2017 11:27 PM |
| Problem solved. Thanks guys! |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2017 01:04 AM |
It was because you forgot the leading 0 when checking the TimeOfDay string for 6am. "6:00:00" vs "06:00:00" |
|
|
| Report Abuse |
|
|