local lightPart = script.Parent
local pointLight = lightPart.PointLight
while true do
wait(0.01)
if game.Lighting:GetMinutesAfterMidnight() > 6 * 60 then
lightPart.Material = Enum.Material.Plastic
pointLight.Enabled = false
end
if game.Lighting:GetMinutesAfterMidnight() < 18 * 60 then
lightPart.Material = Enum.Material.Neon
pointLight.Enabled = true
end
end
COMMUNITY QUESTION
What is my error? Why isn't the light turning on?
1 answer
You watched the ROBLOX tutorial didnt you? Go and rewatch it because you didnt get the script right. Thats the script:
local lightPart = script.Parent
local pointLight = lightPart.PointLight
while true do
wait(0.01)
if game.Lighting:GetMinutesAfterMidnight() > 6 * 60 then
lightPart.Material = Enum.Material.Plastic
pointLight.Enabled = false
end
if game.Lighting:GetMinutesAfterMidnight() > 18 * 60 then
lightPart.Material = Enum.Material.Neon
pointLight.Enabled = true
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Could you point out the difference in your code?
^ Notice how the “<“ on line 10 changed to a “>”. I’ll admit though that the person should point it out as new scripters can easily miss it.