I want to make my own Day/Night cycle, but I don't want to have to type each individual number I want it to. I can just make something like:
game.Lighting.TimeofDay
and then I could make it to where the time increases by 0:00:10 every second.
This is probably going to be really slow, but you can adjust the wait time and how much the clocktime will increase, to your liking.
local Lighting = game:GetService('Lighting') while wait(1) do Lighting.ClockTime = Lighting.ClockTime + .1 end
There are many of these out there however I'll explain how they work. You could do it two ways, using a while loop or an until loop. I would use a while loop for this because it looks like you want this cycle to go forever.
To do this while loop you would do something like this:
while true do -- setting the middle part to true, essentially means it will go on forever. --put whatever you want to happen, here. wait() -- always have a wait inside loops unless there is an end to the loop like a for loop. end
In your case you would want to do:
while true do game:GetService("Lighting"):SetMinutesAfterMidnight(game:GetService("Lighting"):SetMinutesAfterMidnight + .1) wait(1) end
What this does is sets the time of day to the time of day before plus 10 seconds, every second.
if you really want to use TimeOfDay so try this
while true do wait(1) local increase = 10 local first = string.sub(game.Lighting.TimeOfDay,1,6) local num = string.sub(game.Lighting.TimeOfDay,7,8) local new = tostring(num+increase) game.Lighting.TimeOfDay = first..new end
I extract to 2 strings and increase the latter by 10 then reassemble them again.