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
|
  |
| Joined: 30 Aug 2012 |
| Total Posts: 153 |
|
|
| 02 Apr 2015 06:46 PM |
| Btw it's probably totally incorrect. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 02 Apr 2015 06:49 PM |
| if game.Lighting.TimeofDay = "20:00:00" |
|
|
| Report Abuse |
|
|
KhaosRush
|
  |
| Joined: 30 Aug 2012 |
| Total Posts: 153 |
|
| |
|
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 |
|
|