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

Why doesn't it change BrickColor?

local Co1 = "Navy Blue"
local Co2 = "Lily White"
local Hi = game.Workspace:FindFirstChild("Color1")
local Ho = game.Workspace:FindFirstChild("Color2")

if Hi then
	Hi.BrickColor = Co1
end

if Ho then
	Ho.BrickColor = Co2
end

1 answer

✓ Accepted answer

##Problem

You set the BrickColor properties to string values, which can not be done. You also capitalized White and Blue when they should be lowercased.


##Solution

Use the function BrickColor.new() to get the proper BrickColor value. You would also make sure you have the string inside the parenthesis the right case. Otherwise, the script will default to Medium grey or something like that.


##Final Script

local Co1 = "Navy blue"
local Co2 = "Lily white"
local Hi = game.Workspace:FindFirstChild("Color1")
local Ho = game.Workspace:FindFirstChild("Color2")

if Hi then
    Hi.BrickColor = BrickColor.new(Co1)
end

if Ho then
    Ho.BrickColor = BrickColor.new(Co2)
end

######Hopefully this answered your question. If so, do not forget to hit the accept answer button. If you have any questions, feel free to comment below.

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