minutesAfterMidnight = 0
setLights = function()
for i,v in next, workspace:GetChildren() do
if v:IsA("SpotLight") then
v.Enabled = true
end
end
end
while true do
minutesAfterMidnight = minutesAfterMidnight + 10
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(.1)
if game.Lighting.TimeOfDay == "06:00:00" then
setLights(false)
end
if game.Lighting.TimeOfDay == "18:00:00" then
setLights(true)
end
end
wat i have collected from others so far and edited..i have no idea how this works please explain//it is currently not working

2 comments
where exactly do i put tihs in the script?
You replace the "setLights = function() ... end" with that. Also remember to mark this as the answer to your question and give rep.