Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is my script of fog during nightt not worken?

something is wrong or missing i just am too noob to know how to fix it

local Lighting = game:GetService("Lighting")


if game.Lighting.TimeOfDay == '14:00:00' then -- midnight 
	Lighting.FogEnd = 25
else
	Lighting.FogEnd = 100
end

1 comment

0

midnight is 00:00:00, what your doing happens at 2pm

1 answer

It because your defined your script to be set a 2 pm (14:00) all you have to do is change the time Make sure it's in a server script.

local Lighting = game:GetService("Lighting")
-- fog will fade between 25 and 200 studs
Lighting.FogStart = 2500
Lighting.FogEnd = 2000
minutesAfterMidnight = 0
while true do
	minutesAfterMidnight = minutesAfterMidnight + 1

	Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
 
	wait()
end

6 comments

0

it's not working is not doing anything

0

Edited try it now

0

you forgot about the fog

0

Wait

0

Done

0

i want the fog to disapear in daytime

This discussion is preserved as it was. New answers, comments, and votes are closed.