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: Question about Ambient Lighting Shift With Time Script

Previous Thread :: Next Thread 
KhaosRush is not online. KhaosRush
Joined: 30 Aug 2012
Total Posts: 153
02 Apr 2015 06:45 PM
Hey. I'm an amateur scripter and I was just wondering how I could fix this script to make it run properly. I want the Outdoor Ambient to change to [0,0,0] when the time of day is 20:00:00. Here's my script:

while true do
if game.Lighting.TimeofDay = 20:00:00
then game.Lighting.OutdoorAmbient = [0,0,0]
end
end
Report Abuse
KhaosRush is not online. KhaosRush
Joined: 30 Aug 2012
Total Posts: 153
02 Apr 2015 06:46 PM
Btw it's probably totally incorrect.
Report Abuse
drgn42 is not online. drgn42
Joined: 11 Feb 2010
Total Posts: 3231
02 Apr 2015 06:47 PM
TimeofDay is a string value, so put "20:00:00" instead of 20:00:00. And make sure you have a wait in there. It'll crash your game if you don't.

Normal structure of code would have the then on the same line as if like this:

while true do
wait()
if game.Lighting.TimeofDay = 20:00:00 then
game.Lighting.OutdoorAmbient = [0,0,0]
end
end
Report Abuse
drgn42 is not online. drgn42
Joined: 11 Feb 2010
Total Posts: 3231
02 Apr 2015 06:48 PM
Oops, didn't put in the ""'s

while true do
wait()
if game.Lighting.TimeofDay = "20:00:00" then
game.Lighting.OutdoorAmbient = [0,0,0]
end
end
Report Abuse
TheComputerist is not online. TheComputerist
Joined: 28 Oct 2011
Total Posts: 695
02 Apr 2015 06:48 PM
while wait() do
if game.Lighting.TimeofDay = 20:00:00 then
game.Lighting.OutdoorAmbient = Vector3.new(0,0,0)
end
end
Report Abuse
TheComputerist is not online. TheComputerist
Joined: 28 Oct 2011
Total Posts: 695
02 Apr 2015 06:49 PM
if game.Lighting.TimeofDay = "20:00:00"
Report Abuse
KhaosRush is not online. KhaosRush
Joined: 30 Aug 2012
Total Posts: 153
02 Apr 2015 06:50 PM
Thank you so much, guys.
Report Abuse
KhaosRush is not online. KhaosRush
Joined: 30 Aug 2012
Total Posts: 153
02 Apr 2015 06:53 PM
@drgn42 Wait, hold up. Still doesn't work and I used the exact code.
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