I want to do Night/day

Hi my names is pixeluted and i want to do Night/Day my problem is the FogColor dont want change i using Tween Service Here is my script

local Light = game:GetService("Lighting")
local NightFogEnd = 75
local DayFogEnd = 150
local NightClockTime = 0
local DayClockTime = 12
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(
	2,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out
	)
function SetDay()
	local TweenFogDay = TweenService:Create(Light,Info,{FogEnd = DayFogEnd})
	TweenFogDay:Play()
	local TweenClockTime = TweenService:Create(Light,Info,{ClockTime = DayClockTime})
	TweenClockTime:Play()
	local TweenFogColorDay = TweenService:Create(Light,Info,{FogColor = Color3.fromRGB(192, 192, 192)})
	TweenFogColorDay:Play()
end
function SetNight()
	local TweenFogNight = TweenService:Create(Light,Info,{FogEnd = NightFogEnd})
	TweenFogNight:Play()
	local TweenClockTimeNight = TweenService:Create(Light,Info,{ClockTime = NightClockTime})
	TweenClockTimeNight:Play()
	local TweenFogColorNight = TweenService:Create(Light,Info,{FogColor = Color3.fromRGB(0,0,0)})
end
while wait() do
	SetDay()
	wait(10)
	SetNight()
	wait(10)
end

Thank for Reading

1 Like

So your script is trying to emulate fog during the day and the night? Correct me if I’m wrong, but isn’t this something you should be doing with the skybox?

Here’s the article on skyboxes for day and night:

You can set a day and night cycle.

I hope this helps!
Someperson 576

1 Like

Thank you i look to your link wait :slight_smile:

1 Like