Lighting tween doesnt work

im trying to achieve day and night tween changing, if i try to play tween it doesnt work
how would i fix this, is this a roblox issue? in the old script it worked.

local Ambients = {
	Day = {
		FogEnd = 2000,
		FogStart = 0,
		Brightness = 1.5,
		Ambient = Color3.fromRGB(135, 135, 135),
		ClockTime = 8,
	};
	Night = {
		FogEnd = 1000,
		FogStart = 0,
		Brightness = 1,
		Ambient = Color3.fromRGB(102, 102, 102),
		ClockTime = 5,
	}};
local DT = TweenService:Create(game.Lighting,TweenInfo.new(2.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0),Ambients.Day)
local NT = TweenService:Create(game.Lighting,TweenInfo.new(2.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0),Ambients.Night)
DT:Play()

Is there any errors? It worked for me.

local TweenService = game:GetService('TweenService')
local Ambients = {
    Day = {
        FogEnd = 2000,
        FogStart = 0,
        Brightness = 1.5,
        Ambient = Color3.fromRGB(135, 135, 135),
        ClockTime = 8,
    };
    Night = {
        FogEnd = 1000,
        FogStart = 0,
        Brightness = 1,
        Ambient = Color3.fromRGB(102, 102, 102),
        ClockTime = 5,
    }};
local DT = TweenService:Create(game.Lighting,TweenInfo.new(2.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0),Ambients.Day)
local NT = TweenService:Create(game.Lighting,TweenInfo.new(2.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0),Ambients.Night)
DT:Play()

DT.Completed:Wait()
task.wait(1)

NT:Play()

Are you sure that TweenService is a variable?

turns out i was playing both the tweens after the time so i couldn’t notice it after a day after 2 days and a night after 2 nights

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.