Set player bodycolor to value

local Color = player.PlrStats.BodyColor.Value
        BodyColor.HeadColor3 = Color3.fromRGB(Color)
        BodyColor.LeftArmColor3 = Color3.fromRGB(Color)
        BodyColor.RightArmColor3 = Color3.fromRGB(Color)
        BodyColor.LeftLegColor3 = Color3.fromRGB(Color)
        BodyColor.RightLegColor3 = Color3.fromRGB(Color)
        BodyColor.TorsoColor3 = Color3.fromRGB(Color)
        for i, v in pairs(newCharacter.RightHand:GetDescendants()) do
            if v:IsA("BasePart") then
                v.Color = Color3.fromRGB(Color)
            end
        end
        for i, v in pairs(newCharacter.LeftHand:GetDescendants()) do
            if v:IsA("BasePart") then
                v.Color = Color3.fromRGB(Color)
            end
        end

Hello, when this script runs, it turns the players bodycolors to all black, but the value for it isnt black

1 Like

If BodyColor is an RGB value, you don’t need to create a new Color3

Body color is an object. the head color and stuff are the rgbs inside bodycolor

Print this value here.
see what it gives you.

Someone else on a discord server told me to do this, and it prints the color its supposed to be. Apparently it has to actually be numbers to be a color in the script, but since its a variable, its just black, i dont know how to fix it

so the Color value gives you numbers or a string? If its a string could you write it down. It is possible to use strings as BrickColor.new(). But it has to be a valid member of that pallet type.

I dont know what you mean, if this changes anything, the value is a string value

When i print the value it prints this
231, 198, 167

oh so an RGB value. So it seems you did it right for setting the color but could you state where you got the BodyColor from?

local BodyColor = newCharacter:WaitForChild("Body Colors")

newCharacter is the players character

Try disabling this and run the game. Check in the explorer & properties tab and see if the BodyColor colors changed to the corresponding color.

I can tell you that that part of the script has nothing to do with it, the script doesnt even get to those like before setting the rest of the body to black, i do have an error i can show you if i do this

BodyColor.HeadColor3 = Color3.fromRGB(Color)

this is the error
Unable to assign property Color. Color3 expected, got string

Oh so it gives an error.

Replace

with

Color

Im sorry i messed up its actually the other way around, when i only put color like this

BodyColor.HeadColor3 = Color

it gives the error

But when i do this

BodyColor.HeadColor3 = Color3.fromRGB(Color)

it works but it just sets it to black instead of the value color. I feel like it would be way more understandable it someone were to try it out

Is it a server or client-sided script?

This is on a server script in server script service

Ok, so when you run the game as I said earlier, do the body colors show the corresponding color you wanted in the properties?

No, its black. It shows and says

I’m not sure why it’s not working. I searched for reasons on why it may happen and it’s because when you change the appearance of the character for something else again, it will reset the Body Colors to black. Are you sure you don’t change any related appearance later on?

You didn’t put anything for the other 2 arguments, basically your only putting 231, 198, 167 for the R argument.