Hey guys! I’m attempting to make a Christmas tree decorator, and an essential part of a decoration game is customizing the colors! I’m having a hard time with this. I’ve found many of these for Surface guis and gui’s, but none were meant for parts. Do you guys know any good modules or ways to do this?
You could ask the player to input a BrickColor String, or a BrickColor Number.
function Color(part, color)
part.BrickColor = BrickColor.new(color)
end
-- Later:
local color = 1004 or "Really Red" -- Replace this
local part = script.Parent -- Replace this also
Color(part, color)
Sorry, I misread what you’re saying! That’s a good idea, but it would be very tiring as Roblox has hundreds of different color, and there is billions of different RGB colors
Combining the BrickColor code with the Color3 code that @DasKairo provided
-- BrickColor:
function Color(part, color)
part.BrickColor = BrickColor.new(color)
end
-- Color3:
function doColor3(Red, Green, Blue, color)
part.Color = Color3.fromRGB(Red, Green, Blue)
end
-- Later call these:
-- BrickColor:
local color = 1004 or "Really Red" -- Replace this
local part = script.Parent -- Replace this also
Color(part, color)
-- Color3:
local part = script.Parent -- Replace this also
doColor3(255, 0, 0, color)
I’m not sure why you are turning it into a function, that’s kind of unnecessary for such simple of a property change
Unless you are providing a table, you dont need that:
local ColorTable = {
Color3.fromRGB(255,0,0); -- Red
Color3.fromRGB(0,255,0); -- Green
Color3.fromRGB(0,0,255); -- Blue
}
Part.Color = ColorTable[math.random(1, #ColorTable)]
Will they touch the parts to color change or use a gui of some type? Anyways, you could have a number of pre-set colors maybe a brick they walk on or from a gui.
I think you should make 3 scroll bars, for red, green and blue (or simply ask the player for them). Then you could add a frame below to display the current inputted color.