Hello, I'm just getting started and I'm very new to coding. I'd appreciate some light on my issue here.
Thanks!
Lights = script.Parent:GetChildren()
for i, v in pairs(Lights) do
if game.Lighting:GetMinutesAfterMidnight() > 6 * 60 then
v.Material = Enum.Material.Plastic
end
if game.Lighting:GetMinutesAfterMidnight() < 18 * 60 then
v.Material = Enum.Material.Neon -- It breaks here.
end
end

3 comments
Thanks that helped remove the error and I understand how to use :IsA() now! But I decided to move the script to ServerScriptService so I dont have to copy and paste it in every single model and my code is still not working. :(
And I made the Table/Variable Lights = game.Workspace.Lights:GetChildren()
Aha, I figured it out, I just used a 'while true do' loop and now it works perfectly fine.