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

How would I make the script refer to a palette color (in studio) instead of things like "Black"?

pcb = game.Workspace.F1Standard.PrimaryColoredBlocks:GetChildren()

for _,part in pairs(pcb) do
   if part:IsA("BasePart") then
      part.BrickColor = BrickColor.Black()
   end
end

How would I make the script refer to a palette color (in studio) instead of things like "Black"?

(I mean like the palette colors shown HERE)

2 answers

You use the BrickColor.new() constructor. Then just put in the color's correct name as a string argument.

workspace.Part.BrickColor = BrickColor.new("Medium stone grey")

You can also use a number, but I don't recommend this, as it isn't very readable and hard to remember.

I think you just put the palette code into BrickColor.new. Another thing you can use is Color3.new(r,g,b), the three variables passed being the amount of red green and blue you want or RGB.

BrickColor.new(1) -- white on the palette scale

Color3.new(20,0,50) -- Not sure what this amounts to, play around with it

-- Convert BrickColor into Color3
local brickcolor = BrickColor.new("Really red") --Create our new BrickColor
local color = brickcolor.Color --BrickColors have a Color property that returns their Color3

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