I am using your answers for my horror game I am planning on making. I am a bad scripter but very skilled in building. Any answer will help me lots, thank you.
Firstly, before continuing, you should best have all the lights in one location in the Workspace. Maybe have a folder called "Lights" and put all of the lights you want to change in there. Here's a script to put in ServerScriptStorage or Workspace
local folderName = "Lights" local folderLocation = game.Workspace local lightName = "Light" --Name of all of the light instances (SpotLights, PointLights, SurfaceLights, etc.) local turnOnTime = 1080 --When the light turns off (6:00PM) local turnOffTime = 390 --When the light turns off (6:30AM) --To get the time in minutes after midnight, just go into lighting, change the time of day to what you want to find, then --input this in the command bar: --print(game.Lighting:GetMinutesAfterMidnight()) --Variables, edit these if you have it set up differently. game.Lighting.Changed:connect(function(change) if tostring(change) == "TimeOfDay" then local minutes = game.Lighting:GetMinutesAfterMidnight() if minutes < turnOnTime and minutes > turnOffTime then if folderLocation:FindFirstChild(folderName) == nil then warn('Warning! "'..folderName..'" does not exist in '..folderLocation.Name.."!") return end local x = folderLocation:FindFirstChild(folderName):GetChildren() for i = 1,#x do x[i][lightName].Enabled = false end else if folderLocation:FindFirstChild(folderName) == nil then warn('Warning! "'..folderName..'" does not exist in '..folderLocation.Name.."!") return end local x = folderLocation:FindFirstChild(folderName):GetChildren() for i = 1,#x do x[i][lightName].Enabled = true end end end end)