I am a newbie at scripting and acquire serious help. My friend wants me to script him a series of flashing lights(Parts that change material one at a time which will conclude a series of flashing lights after night time arrives and the time needed to change material is at least 1 second). Everything went accordingly to my script(which is showcased below) until the neon parts began slowing down and then randomly started flashing around without being in sync. Any help please?
local lightPart = script.Parent
while true do
wait(1)
if game.Lighting:GetMinutesAfterMidnight() > 6 * 60 then``
``lightPart.Material = Enum.Material.Plastic``
end
if game.Lighting:GetMinutesAfterMidnight() > 18 * 60 then
lightPart.Material = Enum.Material.Neon
wait(1)
lightPart.Material = Enum.Material.Plastic
wait(1)
lightPart.Material = Enum.Material.Plastic
wait(1)
lightPart.Material = Enum.Material.Plastic
wait(1)
lightPart.Material = Enum.Material.Neon
wait(1)
lightPart.Material = Enum.Material.Plastic
wait(1)
lightPart.Material = Enum.Material.Neon
wait(1)
lightPart.Material = Enum.Material.Plastic
wait(1)
lightPart.Material = Enum.Material.Plastic
wait(1)
lightPart.Material = Enum.Material.Plastic
wait(1)
lightPart.Material = Enum.Material.Neon
wait(1)
lightPart.Material = Enum.Material.Plastic
wait(1)
end
end

2 comments
Nope. Just attempted this right now and it still slows down and manages to randomly flash.
Change "wait(3)" on line 11 to wait(1). I put "3" there as that is what your initial script would have done, but if the problem is that it flashes randomly, then, if you look at the script, it actually changes the material to plastic (non-lit) 3 times in a row, and the pattern is a little irregular. I have edited my script above.