Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 9 years ago
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

Log in to vote
2
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

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.

Ad
Log in to vote
0
Answered by 9 years ago

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

Answer this question