function onTouched()
game.Lighting.TimeOfDay= "5:00:00"
while game.Lighting.TimeOfDay<tonumber("6:00:00") do
repeat
game.Lighting.TimeOfDay = game.Lighting.TimeOfDay + "0:01:00"
wait(.1)
until game.Lighting.TimeOfDay > "6:00:00"
end
end
script.Parent.Touched:connect(onTouched)
new to scripting ! current error : attempt to compare string with nil
I've fixed several errors such as above but script doesn't run, I know the issue with it. Is there anyway I can get around this? Do I need to take a different approach?
Not sure where to start D:

2 comments
could you explain a bit more? if you want to make a simple time changing script, it would be: while wait(0.2) do game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight()+1) end
when a player walks on a block this script above is triggered, causing timeofday to go from 5:00:00 to 6:00:00 in a few seconds. Single player game