So basicly, I've been working on my prison game, but the lights for the yard won't turn off at the night. The material changes great. Here's the script:
while true do wait(5) for i, v in pairs(game.Workspace:GetChildren()) do if v.Name == "NeonPart" then v.Material = "Neon" elseif v.Name == "LightPart" then v.SpotLight.Enabled = true end end game.Lighting.TimeOfDay = "00:00:00" game.Lighting.GlobalShadows = false wait(5) for i, v in pairs(game.Workspace:GetChildren()) do if v.Name == "NeonPart" then v.Material = "SmoothPlastic" elseif v.Name == "LightPart" then v.SpotLight.Enabled = false end end game.Lighting.TimeOfDay = "12:00:00" game.Lighting.GlobalShadows = true end
Please note when giving answer, I'm still a beginner with scripting
Uh, I just woke up but it doesn't seen like you even checked if the it was night or day..
if game.Lightning.TimeOfDay == "00:00:00" then --On.. etc end