I'm pretty new at coding. I've been using this ROBLOX game to help me sharpen my skills. This game teaches the basics of Lua and then provides some projects for you to complete. I'm currently stuck on one of these projects.
The project wants you to: Make a loop that changes all the colors in a model to one color every few seconds. Put the list of colors in a table, and have it cycle through the colors in the same order.When it reaches the last color, it will restart and cycle through again. Get all the children from the model with the GetChildren() method and iterate through them with a for loop.
I've tried to complete this project myself but keep failing. The best result I've got is getting a single part to change color and then another part to change color and so on and so on until the parts have cycled through the table of colors.
sp = script.Parent
function LIGHT_IT_UP()
local c = {BrickColor.Red(), BrickColor.Blue(), BrickColor.Green(), BrickColor.Yellow()
}
local m = sp:GetChildren()
while true do
for t = 1, #c do
for i,v in pairs(m) do
if v:IsA("Part") then
v.BrickColor = (c[t])
wait(1)
end
end
end
end
end
game.Players.PlayedAdded:connect(LIGHT_IT_UP)
Hope you lads can help me out.

2 comments
You are waiting per part not per colour.
You're right, thanks!