So, I'm making a script that gradually increases the time of day until the time hits 10:00:00. Here's the script:
local ToD = game.Lighting.TimeOfDay
repeat
wait(0.1)
ToD:SetMinutesAfterMidnight(ToD:GetMinutesAfterMidnight() + 1)
until ToD == "10:00:00"
The problem is that the output says GetMinutesAfterMidnight() is a nil value and the script breaks.
Output: 14:38:18.338 - Workspace.darkness:4: attempt to call method 'GetMinutesAfterMidnight' (a nil value)
I have no idea what's wrong with this script, but I bet some of you guys can help me with this.

2 comments
You are attempting to call 'GetMinutesAfterMidnight' on 'TimeOfDay', not 'Lighting', consider changing to [game.Lighting:GetMinutesAfterMidnight] 'same with [SetMinutesAfterMidnight'.
Oh, ok. I'll try it out.