MinutesAfterNight = 0 while true do wait(0.1) MinutesAfterNight = MinutesAfterNight + 1 game.Lighting:MinutesAfterMidnight = MinutesAfterNight end
It's supposed to set the time to midnight, wait .1 seconds, and then change it 1 minute ahead, and repeat
The script is in serverscriptstorage. No other scripts interfere with it.
It looks like you're trying to use the :SetMinutesAfterMidnight()
method. This isn't something you assign to, it's something you call. When you're calling a function or method, you do not use the =
operator. Instead, you invoke it with ()
and any required arguments.
The proper usage looks like this:
game.Lighting:SetMinutesAfterMidnight(MinutesAfterNight)
You can find plenty of examples on how to use that here.