Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a block that changes colors loop those colors?

Asked by 2 years ago

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.

2 answers

Log in to vote
0
Answered by 2 years ago

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

0
Ok, Thank You! xXmatthewgameingXx 2 — 2y
Ad
Log in to vote
0
Answered by 2 years ago

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

Answer this question