Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Making Moon and Stars show at night?

Asked by 8 years ago

This is what I got so far but it's not working:

~~~~~~~~~~~~~~~~~ local lighting = game:service'Lighting' local sky = Instance.new("Sky", lighting)

while wait() do if lighting.TimeOfDay == "00:00:00" then sky.CelestialBodiesShown = true end end ~~~~~~~~~~~~~~~~~

1 answer

Log in to vote
0
Answered by 8 years ago
local lighting=game:GetService("Lighting")

lighting.Changed:connect(function(property)
    if property=="TimeOfDay" then
        local value=lighting[property]
        if value=="00:00:00" then
            local sky=Instance.new("Sky",lighting)
            sky.CelestialBodiesShown=true
            sky.StarCount=3000
        end
    end
end)

Ad

Answer this question