I tried doing this:
lightPart = game.Workspace.lights:GetChildren() minutesAfterMidnight = 0 while true do 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 end wait(0.1) end
But it didn't work. Help?
lightPart is a table. If you want to get all the parts in the table, you must use a for loop.
It’d be something like this :
for i,part in pairs(lightPart) do part.Material = Enum.Material.Plastic end