I have a block that changes colors, but I don't how to make it loop back to the first color then keep going forever.
COMMUNITY QUESTION
How do I make a block that changes colors loop those colors?
2 answers
You can set a variable of the color, break the loop, then set the block's Color into the color we've just set on the variable
Make sure the script is inside the block
while true do
script.Parent.Color = Color3.fromRGB(255, 0, 4) --change this to what color you want
wait(0.5) -- change this to how long you want until it changes to the next color
script.Parent.Color = Color3.fromRGB(255, 250, 87) --change this to what color you want
wait(0.5) -- change this to how long you want until it go back to the first color
end
to add more color/s, paste this between the last wait() and the end() part
script.Parent.Color = Color3.fromRGB(125,231,17) --again change to what color you want
wait(0.5)
if you want the change of color to be smooth, try TweenService
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Ok, Thank You!