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

I tried to make a part's color the same as a GUI's button color?

Hi, I made an example of what I'm trying to do a I don't want to post my actual script as it's "private."

When I try to make a part's color the same as a GUI button's color, the part turns black. I am trying to use this for a color change gui. Here is the script:

local part = game.Workspace.V
local color = script.Parent.BackgroundColor3

script.Parent.MouseButton1Click:connect(function()
	part.Color = Color3.new(color)
end)

I have also tried "Color3.fromRGB(color)" but the part still turns black. Please help!

1 answer

This should work:

local part = game.Workspace.V
local color = script.Parent.BackgroundColor3

script.Parent.MouseButton1Click:connect(function()
    part.Color = color
end)

You don't need to do Color3.new because you already get that from the value of BackgroundColor3.

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