Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a part randomly change colors constantly, like a disco?

I want to make a part change colors randomly every 0.6 seconds. My code is not working and I don't know what is causing the script to fail. I'm new to scripting, I'm trying to learn. Please take a look at my code below.

`~~~~~~~~~~~~~~~~~ Disco = script.Parent

function randomColor() Disco.BrickColor:Random() wait(0.6) Disco.BrickColor:Random() wait(0.6) end

while true do randomColor() end

`

1 answer

✓ Accepted answer
Disco = script.Parent

function randomColor() 
	Disco.BrickColor = BrickColor.Random()
	wait(0.6) 
	Disco.BrickColor = BrickColor.Random()	
	wait(0.6) 
end

while true do 
	randomColor() 
end

You need to use BrickColor.Random() to make a random brick color.

1 comment

0

Thank you! Worked perfectly! :)

This discussion is preserved as it was. New answers, comments, and votes are closed.