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

Want To Know How To Make a Part Change Color Randomly?

Asked by 10 years ago

If you've always wanted to know how to make a Part Change Color, but randomly, then you've come to the right place.

Firstly you need to insert a Part. After you've inserted a Part, insert a Script into the Brick.

Secondly you need to put the code into the script in order for the Part to change color.

Here's the code:


while true do script.Parent.BrickColor = BrickColor.new.Random() wait(1) script.Parent.BrickColor = BrickColor.new.Random() wait(1) end

And what does this code mean? Let me explain.

So, while true do, means that whilst it's true do this. Meaning if it's true then it has to do something. script.Parent means that find the parent of the script, which in our case would be the Part because the Part is the parent. BrickColor just means BrickColor BrickColor.new means that change it to a new color. .Random() means it will pick a random color out of the color options wait(1) means how long the script waits before it can continue.

Hope you found this helpful, if I made any errors please tell me.

  • Vendaz

1 answer

Log in to vote
0
Answered by 10 years ago

Please only create a question to ask a legitimate question. This is not the place to post tutorials.

Ad

Answer this question