This belongs in #help-and-feedback:code-review, not scripting support.
@SnarlyZoo Is correct that your script will not cause lag. However, it can be improved in other ways.
-
wait(0.25)will not always wait exactly 1/4 of a second.waitis an unstable function and doesn’t always do what you want. -
You don’t need to update lighting every fourth of a second anyways
Combining these two pieces of advice:
local lighting = game:GetService("Lighting")
local minutes = 840
local GAME_MIN_PER_REAL_MIN = 10 -- game time runs 10 times faster than real time
local DO_UPDATE_EVERY = 5 -- update lighting every 5 seconds (independent of above setting)
while true do
lighting:SetMinutesAfterMidnight(minutes)
local secondsActuallyWaited = wait(DO_UPDATE_EVERY)
minutes += GAME_MIN_PER_REAL_MIN * secondsActuallyWaited / 60
end