0 views0 copies0 likes
Smooth Day and Night Cycle for Maps
Universal script
Copy it, then test it in your own Studio place.
Script code
9 lines ยท 0.3 KBlocal Lighting = game:GetService("Lighting")local realSecondsPerDay = 240local began = workspace:GetServerTimeNow()local firstHour = 7while true do local elapsed = workspace:GetServerTimeNow() - began Lighting.ClockTime = (firstHour + elapsed * 24 / realSecondsPerDay) % 24 task.wait(0.25)endAbout this script
Add this server Script to cycle Lighting.ClockTime across a complete day every four minutes. It measures elapsed server time instead of adding a fixed amount each frame, so scheduler delays do not slow the cycle. Begin at morning, then test sunrise and sunset while your usual lighting effects are active. Tune realSecondsPerDay independently of your round length.
Log in to leave a comment.
No comments yet
Be the first to share your thoughts!
Comments
Share what works, ask questions, or report an issue.