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

Help with changing ambiency?

Asked by 8 years ago
Edited 8 years ago

This is in a serverscript in server script service with FE turned on.

minutesAfterMidnight = 1320000
while wait(.5) do
    minutesAfterMidnight = minutesAfterMidnight + 2
    game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
    if game.Lighting.TimeOfDay == "20:00:00" then
        game.Lighting.Brightness = 0
        game.Lighting.Ambient = Color3.new(0,0,0)
        game.Lighting.FogColor = Color3.new(0,0,0)
    elseif game.Lighting.TimeOfDay == "8:00:00" then
        game.Lighting.Brightness = 1
        game.Lighting.Ambient = Color3.new(128/255, 128/255, 128/255) -- This part doesn't change the ambiency
        game.Lighting.FogColor = Color3.new(128/255, 128/255, 128/255)
    end
end
0
I would say, use a LocalScript. MessorAdmin 598 — 8y
1
No. The problem is most liekly that the TimeOfDay will never equal _exactly_ 20:00:00 or 8:00:000. You should check within a range to be safe. Another reason might be that you aren't noticing the Ambience change, try changing the OurdoorAmbient property. jakedies 315 — 8y

Answer this question