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

How to make part keep repeat changing color?

Asked by 8 years ago

I forgot how to make the part changing color, if anyone know tell me.

0
part.BrickColor = BrickColor.Random() will change a parts color to a random BrickColor theCJarmy7 1293 — 8y
0
Is that will keep repeat? User#13091 0 — 8y
0
Do a loop if you want it to repeat theCJarmy7 1293 — 8y

1 answer

Log in to vote
0
Answered by
theCJarmy7 1293 Moderation Voter
8 years ago

First of all, the guy who posted this question, megaSomething, posted an answer that contained this.

repeat
part.BrickColor=BrickColor.Random()
wait 1





No, that has some syntax errors.

for q=1,100 do

end

That's a loop setup right there, there are other loops but I'm going to be using the for loop.

So if you read up on for loops, you'll know that loop in the code block will run 100 times

for q=1,100 do
    part.BrickColor = BrickColor.Random()
    wait(1)
end

And that will make a parts BrickColor be random, and change every second, 100 times.

As for your syntax errors, here they are.

repeat 
    --the setup for a repeat loop
until true


wait(1)
 --as opposed to
wait 1
Ad

Answer this question