|
| 02 Jun 2013 03:46 PM |
local s = script.Parent
while wait(1/30) do if game.Lighting.TimeOfDay == "6:00:00" then s.Lighting.Brightness = 1 s.Lighting.Ambient = 0,0,0 end if game.Lighting.TimeOfDay == "18:00:00" then s.Lighting.Brightness = 0 s.Lighting.Ambient = 116,116,116 end
--Does nothing :c no outputs, help?? |
|
|
| Report Abuse |
|
|
ellosss
|
  |
| Joined: 15 Mar 2009 |
| Total Posts: 7030 |
|
| |
|
|
| 02 Jun 2013 03:51 PM |
| ...The ambient and brightness dont change but yea that was one problem :P |
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 02 Jun 2013 03:54 PM |
Try
s.Lighting.Ambient = Color3.new(116/255, 116/255, 116/255) |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 03:57 PM |
Doesn't work I don't know if it makes any difference but here's the whole script
while true do game.Lighting:setMinutesAfterMidnight(game.Lighting:getMinutesAfterMidnight()+.25) wait(.1) end
local s = script.Parent
while wait(1/30) do if game.Lighting.TimeOfDay == "6:00:00" then s.Lighting.Brightness = 1 s.Lighting.Ambient = Color3.new(0/255, 0/255, 0/255) end if game.Lighting.TimeOfDay == "18:00:00" then s.Lighting.Brightness = 0 s.Lighting.Ambient = Color3.new(116/255, 116/255, 116/255) end end
|
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 02 Jun 2013 03:58 PM |
| Wait, where is this script located? Workspace? |
|
|
| Report Abuse |
|
|
| |
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 02 Jun 2013 04:00 PM |
... There is no Lighting in Workspace...
game.Lighting.Ambient = Color3.new(116/255, 116/255, 116/255) |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 04:01 PM |
| Whoops. Its been a long day |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 04:02 PM |
| Still doesn't change the ambient or brightness |
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 02 Jun 2013 04:07 PM |
I think its because you have two while loops in the script and only one is running (Because the first while loop is set to run forever).
Use a coroutine!
local Time = coroutine.create(function() while true do game.Lighting:setMinutesAfterMidnight(game.Lighting:getMinutesAfterMidnight()+.25) wait(.1) end end)
coroutine.resume(Time)
while wait() do if game.Lighting.TimeOfDay == "6:00:00" then game.Lighting.Brightness = 1 game.Lighting.Ambient = Color3.new(0/255, 0/255, 0/255) elseif game.Lighting.TimeOfDay == "18:00:00" then game.Lighting.Brightness = 0 game.Lighting.Ambient = Color3.new(116/255, 116/255, 116/255) end end |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 04:09 PM |
| *Gasp!* But... Those are for smart people XD alright well thanks :P |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 02 Jun 2013 04:10 PM |
No they are very easy once you have used them once
|
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 02 Jun 2013 04:11 PM |
| Coroutines are actually very easy to use, and no problem. |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 04:12 PM |
| Noooo! It still doesnt work :c scripts hate me i swear |
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 02 Jun 2013 04:13 PM |
| I have no idea why it wouldn't since I made that and tested it in Studio... |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Jun 2013 04:15 PM |
| Yea wait what e.e scripts hate me! D: lol whai it no work :c The script is just in workspace, and not a block or anything? |
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 02 Jun 2013 04:23 PM |
if game.Lighting.TimeOfDay == "06:00:00" then
Sorry about that... ._. |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 04:24 PM |
| lol dw i should have seen that :3 |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 04:27 PM |
| It works now thanks so much :D |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 04:28 PM |
Here try this, it may not make a big difference, but I guess it's worth a shot.
lighting = game:GetService("Lighting")
local Time = coroutine.create(function() while true do lighting:setMinutesAfterMidnight(lighting:getMinutesAfterMidnight()+.25) wait(.1) end end)
coroutine.resume(Time)
while wait() do if lighting.TimeOfDay == "6:00:00" then lighting.Brightness = 1 lighting.Ambient = Color3.new(0/255, 0/255, 0/255) elseif lighting.TimeOfDay == "18:00:00" then lighting.Brightness = 0 lighting.Ambient = Color3.new(116/255, 116/255, 116/255) end end |
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
| |
|
|
| 02 Jun 2013 04:29 PM |
| Sorry missed the last few posts >.< Come on, i've made a lens flare, and I even missed that Lol |
|
|
| Report Abuse |
|
|
| |
|