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

(easy) my Brick wont stop changing colors until its black?

The = is underlines red

while true do
	
	script.Parent.BrickColor = BrickColor.Random()
	wait(0.5)
	script.Parent.BrickColor = BrickColor.Random()
	repeat
		
	until
	
	script.Parent.BrickColor = BrickColor.new("Black")
	
	

end

1 answer

✓ Accepted answer

Hey Snipper!

I've made a fix to your bit of code by removing the repeat until. Also, an reason that the '=' is underlined red is because the code expects the boolean operator "==".



while true do
	script.Parent.BrickColor = BrickColor.Random()
	wait(0.5)
	
	if script.Parent.BrickColor == BrickColor.Black() then
		break
	end
end

So that break command after the "if then" statement forces the loop to end there.

Hope this helps.

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