Hey help me with TweenService! Day/Night mode

Hello guys. How can I make the following script color change with tween? I would like it to change smoothly.

local WhiteColor = Color3.fromRGB(255, 255, 255)
local DarkColor = Color3.fromRGB(29, 35, 58)

while true do
	
	-- Dark mode:
	script.Parent.TextColor3 = WhiteColor
	script.Parent.BackgroundColor3 = DarkColor
	script.Parent.BorderColor3 = DarkColor
    wait(10)
	
	-- Day mode:
	script.Parent.TextColor3 = DarkColor
	script.Parent.BackgroundColor3 = WhiteColor
	script.Parent.BorderColor3 = WhiteColor
	wait(10)

end

Hope this helps!

local TweenService = game:GetService("TweenService")
local Cycle_Info = TweenInfo.new(10, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)

local WhiteColor = Color3.fromRGB(255, 255, 255)
local DarkColor = Color3.fromRGB(29, 35, 58)

local Dark_Mode_Tween = TweenService:Create(
	
	script.Parent,
	Cycle_Info, 
	{TextColor3 = WhiteColor, BackgroundColor3 = DarkColor, BorderColor3 = DarkColor}
	
)

local Day_Mode_Tween = TweenService:Create(

	script.Parent,
	Cycle_Info, 
	{TextColor3 = DarkColor, BackgroundColor3 = WhiteColor, BorderColor3 = WhiteColor}

)

while true do

	-- Dark mode:
	Dark_Mode_Tween:Play()
	Dark_Mode_Tween.Completed:Wait()

	-- Day mode:
	Day_Mode_Tween:Play()
	Day_Mode_Tween.Completed:Wait()

end
1 Like