01 | skies = { |
02 | "s1" , |
03 | "s2" , |
04 | "s3" } |
05 | while true do |
06 | csky = math.random( 1 , #skies) |
07 | wait( 0.001 ) |
08 | if game.Lighting:GetMinutesAfterMidnight() = = 0 then |
09 | if skies [ csky ] = = "s1" then |
10 | game.Lighting.Sky.SkyboxBk = "rbxassetid://558861298" |
11 | game.Lighting.Sky.SkyboxDn = "rbxassetid://558860805" |
12 | game.Lighting.Sky.SkyboxFt = "rbxassetid://558861465" |
13 | game.Lighting.Sky.SkyboxLf = "rbxassetid://558860596" |
14 | game.Lighting.Sky.SkyboxRt = "rbxassetid://558861057" |
15 | game.Lighting.Sky.SkyboxUp = "rbxassetid://558861628" |
Edit: I forgot to mention, the script is in game.Lighting.Sky
Hmm, I think the problem is that it's just missing the point where MinutesAfterMidnight is 0. I'm not 100% sure, but try this:
01 | --Assuming that this is a Server script (which it hopefully is) |
02 | skies = { |
03 | "s1" , |
04 | "s2" , |
05 | "s3" } |
06 | game.Lighting.LightingChanged:connect( function () |
07 | if game.Lighting:GetMinutesAfterMidnight() = = 0 then |
08 | csky = math.random( 1 , #skies) |
09 | if skies [ csky ] = = "s1" then |
10 | game.Lighting.Sky.SkyboxBk = "rbxassetid://558861298" |
11 | game.Lighting.Sky.SkyboxDn = "rbxassetid://558860805" |
12 | game.Lighting.Sky.SkyboxFt = "rbxassetid://558861465" |
13 | game.Lighting.Sky.SkyboxLf = "rbxassetid://558860596" |
14 | game.Lighting.Sky.SkyboxRt = "rbxassetid://558861057" |
15 | game.Lighting.Sky.SkyboxUp = "rbxassetid://558861628" |
Lighting has an event which fires every time a property of game.Lighting is changed. As I said, I'm not completely sure it will work, as I personally haven't done much work when it comes to lighting, but try it nonetheless. :)