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 » Scripting Helpers
Home Search
 

Re: Day and Night

Previous Thread :: Next Thread 
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
02 Feb 2013 05:17 AM
I have this, but I want the lighting to go dark at night time, so its quite hard to see. Is this possible to do without a GUI?

l = game:service("Lighting")
r = game:service("RunService")

while true do
--Time and day
l:SetMinutesAfterMidnight(l:GetMinutesAfterMidnight()+0.1)
wait(.1)
end
Report Abuse
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
02 Feb 2013 05:24 AM
Bump
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
02 Feb 2013 05:28 AM
Change the ambient. Also, you don't need the 'r' variable.
Report Abuse
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
02 Feb 2013 05:40 AM
How would I change the ambient so it only changes at night time?
Report Abuse
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
02 Feb 2013 05:48 AM
I want to make it so when it gets to night the screen gets darker and darker so you can barely see and after 2am it gets less darker and lighter to daytime agaibn.
Report Abuse
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
02 Feb 2013 06:28 AM
??
Report Abuse
HD188753 is not online. HD188753
Joined: 13 Jun 2012
Total Posts: 5021
02 Feb 2013 06:34 AM
Use a script to check time and then accordingly change GUI transparency.
Report Abuse
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
02 Feb 2013 06:56 AM
I want to do it without GUis though..
Report Abuse
UnequaledDonovan1 is not online. UnequaledDonovan1
Joined: 28 Oct 2012
Total Posts: 3909
02 Feb 2013 08:25 AM
and its GetService() not service()
Report Abuse
Xzerizon is not online. Xzerizon
Joined: 16 Aug 2011
Total Posts: 2174
02 Feb 2013 09:11 AM
Add a condition checker (if) and set it to check if the time is equal to 1080 minutes after midnight. If it is, make the screen darker. 360 minutes after is 6:00:00.
Report Abuse
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
02 Feb 2013 01:02 PM
Im still confused, I'm quite a novice at scripting I watched pigheads youtubes.
What is like the full line of script to change ambient?
Report Abuse
Th30racle is not online. Th30racle
Joined: 03 Nov 2012
Total Posts: 214
02 Feb 2013 01:08 PM
game.Lighting.FogEnd = (35)
game.Lighting.FogColor = Color3.new(0,0,0)

Makes black fog. Hard to see through.
Report Abuse
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
03 Feb 2013 07:19 AM
And how would I make it so this only happens at night, and changes back at day, based on my day and night script?
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
03 Feb 2013 08:16 AM
l= game:service("Lighting")
r = game:service("RunService")

while true do
--Time and day
l:SetMinutesAfterMidnight(l:GetMinutesAfterMidnight()+0.1)
if l.TimeOfDay == 18:00:00 then
l.FogEnd = 350
elseif l.TimeOfDay == 06:00:00 then
l.Fogend = 700
wait(.1)
end

still missing check function for the TimeOfDay.
Report Abuse
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
03 Feb 2013 09:18 AM
^So would that work?
Report Abuse
Xzerizon is not online. Xzerizon
Joined: 16 Aug 2011
Total Posts: 2174
03 Feb 2013 10:54 AM
^No.

You would get the error 'Attempt to compare number value with a sring value.'

Enclose the times in quotation marks.

"6:00:00"
"18:00:00"

Ғľ○ωε⌐'ζ бâŋε ▬ Xζε⌐¡ζ○╖
Report Abuse
bigdaddy92 is not online. bigdaddy92
Joined: 17 Jan 2010
Total Posts: 1684
03 Feb 2013 11:02 AM
Mess with the lighting setting while using :GetMinutesAfterMidnight to see if it is night.

-bigdaddy92, Professional Web Developer & Master Scripter
Report Abuse
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
03 Feb 2013 11:16 AM
l= game:service("Lighting")
r = game:service("RunService")

while true do
--Time and day
l:SetMinutesAfterMidnight(l:GetMinutesAfterMidnight()+0.1)
if l.TimeOfDay == "18:00:00" then
l.FogEnd = 350
elseif l.TimeOfDay == "06:00:00" then
l.Fogend = 700
wait(.1)
end

This would work?
Report Abuse
bigdaddy92 is not online. bigdaddy92
Joined: 17 Jan 2010
Total Posts: 1684
03 Feb 2013 11:18 AM
That says if it is EXACTLY that time, for that .1 seconds, so no.

-bigdaddy92, Professional Web Developer & Master Scripter
Report Abuse
Xzerizon is not online. Xzerizon
Joined: 16 Aug 2011
Total Posts: 2174
03 Feb 2013 11:22 AM
I would use game.Lighting:GetMinutesAfterMidnight() == 360 to check the time. I find it more reliable.

Ғľ○ωε⌐'ζ бâŋε ▬ Xζε⌐¡ζ○╖
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
03 Feb 2013 11:28 AM
I think you might be looking for:

  if l.TimeOfDay ​> "18:00:00" and l.TimeOfDay < "6:00:00" then

and

  elseif l.TimeOfDay ​>= "6:00:00" and l.TimeOfDay <= "18:00:00" then
Report Abuse
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
03 Feb 2013 12:56 PM
I'm not begging for you to make me a script but could one of you just complete it so I can see how it works because I'm totally confused right now.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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