Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Solved] Neons not switching at certain times of the day?

Asked by 8 years ago

I have posted a similar question before; however, I have been tinkering with the script to make it more simplistic. I now have a problem where all the neon parts, "leds", are not changing color at their certain times. They always stay the same "Bright yellow" color and never change to "Deep blue". Note, I have put all of these leds in a folder, if that helps anyone.

leds = game.Workspace.LEDS:GetChildren()

minutesAfterMidnight = 5*60
while true do
    minutesAfterMidnight = minutesAfterMidnight + 8
    game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
    wait(.1)

    if game.Lighting.TimeOfDay == "06:00:00" then
        for i,v in ipairs(leds) do
            if v:IsA("BasePart") or v:IsA("WedgePart") or v:IsA("UnionOperation") then
                v.BrickColor = BrickColor.new("Deep blue")  
                end

    if game.Lighting.TimeOfDay == "18:00:00" then
        for i,v in ipairs(leds) do
            if v:IsA("BasePart") or v:IsA("WedgePart") or v:IsA("UnionOperation") then
                v.BrickColor = BrickColor.new("Bright yellow")              
                    end
                end
            end
        end
    end
end

Answer this question