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

Is there an easy way to get a color3 from a brick color?

Asked by 6 years ago

I'm trying to make a script that finds your skin color and then changes the background color of a set of ImageButtons to that same color, but the color of ImageButtons use Color3, and skin color uses Brick Color. I know I could just make a bunch of 'if' and 'elseif' statements for each kind of skin color but I'd rather find an easier and less boring way to do it. This is the important part of my script:

local head = plr.Character["Body Colors"].HeadColor
local decals = plr.PlayerGui.GUI.Frame.ScrollingFrame:GetChildren()
    for i = 1, #decals do
        decals[i].BackgroundColor3 = head
    end

I have the error message if it helps understanding the problem since I'm terrible at explaining things

bad argument #3 to 'BackgroundColor3' (Color3 expected, got BrickColor)

1 answer

Log in to vote
0
Answered by
DanzLua 2879 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago

Well there is a Color3 property of brickcolor so all you would have to do is thebrickcolor.Color

local head = plr.Character["Body Colors"].HeadColor
local decals = plr.PlayerGui.GUI.Frame.ScrollingFrame:GetChildren()
for i = 1, #decals do
    decals[i].BackgroundColor3 = head.Color
end
Ad

Answer this question