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

Sun is supposed to move around but stays in sky?

Hi, I wrote some code and it is supposed to move the sun and its for a game where i want an interactive day night cycle, but instead, the sun stays in place in the sky. Here's the code:

dayTime = 300
interval = 24 / dayTime
while wait(1) do
	game.Lighting.ClockTime += interval
end

1 answer

✓ Accepted answer

Hi, put this script in serverscriptservice Script:

local Time = 0.01 --feel free to play with the numbers to set how you want it
local TimeChange = 0.01 --feel free to play with the numbers to set how you want it
while wait(Time) do
game.Lighting.ClockTime = game.Lighting.ClockTime + TimeChange
end

3 comments

0

Thank you, the sun now moves.

0

No problem

0

Happy to help

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