generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Day Night Cycle

Previous Thread :: Next Thread 
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
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
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
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
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
13 Jul 2017 12:41 PM
I hate Roblox sometimes.

goo.gl/uNvgQB

Report Abuse
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
13 Jul 2017 12:42 PM
^ Link to script.
Report Abuse
doggy00 is online. 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 is online. 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 is online. 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
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
13 Jul 2017 02:50 PM
No error in output.
Report Abuse
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
13 Jul 2017 03:39 PM
Bump...
Report Abuse
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
13 Jul 2017 04:04 PM
Bump
Report Abuse
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
13 Jul 2017 10:30 PM
Bump...........
Report Abuse
doggy00 is online. 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
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
13 Jul 2017 10:41 PM
Yeah.. Tried it.
Report Abuse
Jon_TheDev is not online. Jon_TheDev
Joined: 22 Jul 2013
Total Posts: 114
13 Jul 2017 10:44 PM
Put 'minutesAfterMidnight = minutesAfterMidnight + 1' after 'game.LIghting:SetMinutesAfterMidnight(minutesAfterMidnight)


--Jon_TheDev
Report Abuse
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
13 Jul 2017 11:27 PM
Problem solved. Thanks guys!
Report Abuse
WillieTehWierdo200 is not online. WillieTehWierdo200
Joined: 13 Aug 2008
Total Posts: 1147
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image