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

Im trying to make two things the same color in a color randomizer so it matches, can anyone help me?

local Colors = {"Bright red","Bright blue","Bright green","Bright violet", "Carnation pink", "Really black", "Institutional white", "Gold", "Bright Orange" } 
local randomColor = Colors[math.random(1,#Colors)]
script.Parent.BrickColor = BrickColor.new(randomColor)
script.Parent.Parent.Parent.Clothing.Color3 = BrickColor.new(randomColor)

Here is the script, it is a hat and clothing that im trying to change colors from an NPC I am creating. Any help would be greatly appreciated.

2 answers

local RandColor = BrickColor.Random()
local R,G,B = RandColor.Color.r, RandColor.Color.g, RandColor.Color.b

script.Parent.BrickColor = RandColor
script.Parent.Parent.Parent.Clothing.Color = Color3.new(R, G, B)

:) If this works make to sure to tell me.

1 comment

0

There's another way! See my answer c:

local brick1 = workspace.part
local brick2 = workspace.part2

brick1.BrickColor = brick1.BrickColor:Random()
brick2.BrickColor.R = brick1.BrickColor.R
brick2.BrickColor.B = brick1.BrickColor.B
brick2.BrickColor.G = brick1.BrickColor.G

-- there you go c:

if it work, upvote this, or mark this as a answer! thanks for your cooperation c:

1 comment

0

simply this are make a brick random brickcolor, and set the brick2's brick color become the brick's brick color's R,B and G.

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