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

Is line 3 of the 'while condition do' function correct?

Trying to make a function where the brick color changes randomly and stops changing once reaches the color, dark blue.

local a = script.Parent

while a.BrickColor ~= "Dark blue" do --this line is not being executed properly
	a.BrickColor = BrickColor.Random()
	wait(0.25)
end

1 answer

✓ Accepted answer
local a = script.Parent

while a.BrickColor ~= BrickColor.new("Dark blue") do --You must call BrickColor.new when designating a BrickColor.
    a.BrickColor = BrickColor.Random()
    wait(0.25)
end

1 comment

1

Thanks! It worked perfectly.

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