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

Fog not changing depending of the day time?

Asked by 6 years ago

Alright, so I tried to modifiy a little bit some day changing script to be able to change the fog properties instead of the outdoor ambient. Here's what it gave:

L = game:GetService("Lighting") 


while true do 
    wait(1)
    T = L:GetMinutesAfterMidnight()
    L:SetMinutesAfterMidnight(T + 1)
    if T < 300 then --Night time, after midnight.
game.Lightning.FogStart = 0
    game.Lightning.FogEnd = 4000
    elseif T > 300 and T < 390 then --Dawn, sun rise.
game.Lightning.FogStart = 0
    game.Lightning.FogEnd = 400 
    elseif T > 390 and T < 600 then --Morning.
game.Lightning.FogStart = 10
    game.Lightning.FogEnd = 200
    elseif T > 600 and T < 840 then --Day time.
game.Lightning.FogStart = 0
    game.Lightning.FogEnd = 10000
    elseif T > 840 and T < 1050 then --Afternoon.
game.Lightning.FogStart = 0
    game.Lightning.FogEnd = 10000
    elseif T > 1050 and T < 1140 then --Evening, sun set.
game.Lightning.FogStart = 0
    game.Lightning.FogEnd = 10000
    elseif T > 1140 then --Night time, before midnight.
game.Lightning.FogStart = 0
    game.Lightning.FogEnd = 4000
    end     
end

Even though, it doesn't seem like it's working, and I tried many hours to find out what went wrong with it. Could somebody help me?

0
Use Lighting, not Lightning. There is no such thing called Lightning, it is a common spelling mistake. TheDeadlyPanther 2460 — 6y

1 answer

Log in to vote
0
Answered by
Bellyrium 310 Moderation Voter
6 years ago

every line past 9 says game.Lightning instead of lighting, or even L. That's a red flag off the bat

0
Tested with game.Lightning changed to L and it works for me Bellyrium 310 — 6y
0
This is something you say in a comment, not an answer. You also spelt Lighting wrong twice. TheDeadlyPanther 2460 — 6y
1
Someone is grouchy.. Bellyrium 310 — 6y
0
Worked for me, thank you! loicomialo 12 — 6y
View all comments (2 more)
0
I'm not grouchy, I'm just correcting you. And no problem, loic. TheDeadlyPanther 2460 — 6y
0
This is a perfectly fine answer because it worked for the asker obviously.. chill TDP Goulstem 8144 — 6y
Ad

Answer this question