Need help with body colors

So i have armor suits that don’t fully encase the character, also the only reliable way of preventing player accessories from overlapping, was to clear their character, though now i have the issue of body colors that need to be changed too, though i’m completelly stuck.
While i can’t show the exact code, the way the armor works, is that there’s outside scripts that parent it to the character and if armor detects that it’s been parented to a player character, it executes all sorts of stuff, ranging from attaching the armor to the character, to changing their stats, like walkspeed and max health. Though what i’m asking here in this case, is how could i change body colors of the character that equips the armor?

If you wish to change the Player’s skin tone, you can simply get the Player’s character in the Script, and use for i, v in pairs loop to loop through and change every part in the Player’s character. Something like:

for i, v in pairs(Character:GetChildren()) do
   v.Color = Color3.fromRGB(0, 0, 0) -- Insert your color here
end)

does not work, it’s a server script though.

This right here is how i get player character by the way:

local plr = script.Parent.Parent

Could you show the hierarchy of the Script? I can’t really deduce much from just 1 line of code.

Here:

local main = script.Parent
local A = script.Parent.Main.ArmorPoint
local M = script.Parent.Main
local HL = script.Parent.Helmet.Mask
local L = script.Parent.LHand
local R = script.Parent.RHand
local plr = script.Parent.Parent
local LH = plr:WaitForChild("Left Arm")
local RH = plr:WaitForChild("Right Arm")
local LHA = LH:WaitForChild("LeftShoulderAttachment")
local RHA = RH:WaitForChild("RightShoulderAttachment")
local hrp = plr:WaitForChild("Torso")
local B = hrp:WaitForChild("WaistCenterAttachment")
local H = plr:WaitForChild("Humanoid")
local HD = plr:WaitForChild("Head")
local HDA = HD:WaitForChild("HatAttachment")
local wearable = plr:FindFirstChildOfClass("Accessory")
local LL = plr:WaitForChild("Left Leg")
local RL = plr:WaitForChild("Right Leg")

Screenshot_2241

1 Like

Please ignore this by the way, that’s just a leftover of an obsolete line of code.

@Deb0rahAliWilliams got the main idea, only a few problems

``

for i,v in pairs(Character:GetDescendants()) do-- if you want to change accessories
   if v:IsA("BasePart") then
      v.Color = Color3.fromRGB(0,0,0)
   end
end)

``

1 Like

i already have a code running that clears the Avatar, this just makes it even worse.
clearly you did not read the entirety of my post.

sorry for the obvious rush on the first reply, but have you tried bodycolors? yeah I tried the color script on my character, there is a body color in the player, and that overrides all part colors. if you want to change the color, this post will help

How to set Body Colors’s colors with a script? - Help and Feedback / Scripting Support - Developer Forum | Roblox