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

How to Tween TimeOfDay properly?

Greetings, everyone. I was trying to do a script where it tweens the time of day to night. Sadly, it doesn't seem to work, how do I tween the time of day properly? Here is my current script:

elseif message == "!night" then
			local tweenInfo3 = TweenInfo.new(
   			 3,
   			 Enum.EasingStyle.Linear,
  		 	 Enum.EasingDirection.In,
  		  	 0,
   			 false,
    		 	0
			)
			local tween3 = teenService:Create(game.Lighting, tweenInfo3, {TimeOfDay = 0})
		end

1 comment

0

I added that to the script later on, still didn't work. It is solved now tho. I used ClockTime instead of TimeOfDay and it is seeming to work, thank you for the response tho.

1 answer

✓ Accepted answer

U are not playing the tween, do tween3:Play() Also, TimeOfDay is a string, not a number

i think you that you want Lighting.ClockTime instead so

  local tweenInfo3 = TweenInfo.new(
	             3,
             Enum.EasingStyle.Linear,
             Enum.EasingDirection.In,
             0,
	             false,
               0
	            )
	            local tween3 = teenService:Create(game.Lighting, tweenInfo3, {ClockTime = 0})
tween3:Play()

1 comment

0

Yes! I just found out I would have to use Lighting.ClockTime instead of TimeOfDay, thank you for the response tho!

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