Loops let you repeat work without copy-pasting, and now we get to point one straight at something visual. You’re going to grab a part and make it cycle through colors forever, like a little disco light. This is your first loop that you can actually watch run.
The plan is exactly what you’d guess. Open a while true do loop, set the part’s Color to one shade, wait a second, set it to the next, wait, and so on. Because the loop never ends, the part keeps cycling as long as the game runs.
local part = script.Parent
while true do
part.Color = Color3.fromRGB(255, 0, 0) -- red
wait(1)
-- add the next color here, then wait again
end
Remember the wait lesson? That wait(1) is doing two jobs at once. It keeps the loop from exhausting the engine, AND it’s the reason you can see each color instead of a blur. The hint matters here: pause first, then change, so each shade actually gets its full second on screen. Try it without the wait once just to watch it fail, then put it back.
Now make it yours: add a fourth color to the cycle, or speed the whole thing up to half a second each. Pick colors that look good together and make it your own light show.