So im trying to make a script in where the lights (surfacelights) turn off during the day and turn on at night. I don't really have much experience with scripting and I'm using a script that works similarly that my friend made. I edited it but it doesnt work. Its giving me no errors in the console so I don't know what the issue is. Here is the script.
while true do wait(0.1) if math.floor(game.Lighting:GetMinutesAfterMidnight()/60) >= 18 or math.floor(game.Lighting:GetMinutesAfterMidnight()/60) < 6 then for i, v in pairs(script.Parent.Lights.Light.SurfaceLight:GetChildren()) do v.Brightness = 0 end else for i, v in pairs(script.Parent.Lights.Light.SurfaceLight:GetChildren()) do v.Brightness = 0.5 end end end
