Character customization [Body color]

I am currently trying to make a character customization system for my RPG game, ESHU and i am struggling whith the body color customization:

  • DataScript

 game.Players.PlayerAdded:Connect(function(player)--here player means the player who will join 
 the game

local leaderstats = Instance.new("Folder")
leaderstats.Name = "customization"
leaderstats.Parent = player

local bodyColor = Instance.new("Color3Value")
bodyColor.Value = Color3.new(0.231373, 0.184314, 0.14902)
bodyColor.Name = "bodyColor"
bodyColor.Parent = leaderstats


---Clothes
local shirtfold = Instance.new("Folder")
shirtfold.Parent = leaderstats
shirtfold.Name = "shirtfold"
local shirtAcc = Instance.new("Accessory")
shirtAcc.Parent = shirtfold
shirtAcc.Name =  "shirtAcc"

local pantsfold = Instance.new("Folder")
pantsfold.Parent = leaderstats
pantsfold.Name = "pantsfold"
local pantsAcc = Instance.new("Accessory")
pantsAcc.Parent = pantsfold
pantsAcc.Name =  "pantsAcc"

----- BodyColor
player.CharacterAdded:Connect(function(char)
	local function applyColorToParts()
		local charChilds = char:GetChildren()
		for _, charChild in pairs(charChilds) do
			if charChild:IsA("MeshPart") then
				charChild.BrickColor = BrickColor.new(bodyColor.Value)
			end
		end
	end

	applyColorToParts()

	player.CharacterAdded:Connect(function(nchar)
		char = nchar
		applyColorToParts()
	end)

	bodyColor.Changed:Connect(function()
		applyColorToParts()
	end)
 end)
end)

  • Local Script

local plr = game.Players.LocalPlayer
local customization = plr:WaitForChild(“customization”)
local bodyColor = customization:WaitForChild(“bodyColor”)

local palette = script.Parent.Palette
local descendants = palette:GetDescendants()

local UIStroke = script.UIStroke

bodyColor.Changed:Connect(function()
for _,descendant in pairs(descendants) do
if descendant:IsA(“TextButton”) and descendant:FindFirstChildWhichIsA(“Color3Value”)
then
if descendant:FindFirstChildWhichIsA(“Color3Value”).Value == bodyColor.Value then
UIStroke.Parent = descendant
end
end
end
end)

for _,descendant in pairs(descendants) do
if descendant:IsA(“TextButton”) and descendant:FindFirstChildWhichIsA(“Color3Value”) then
descendant.MouseButton1Click:Connect(function()
bodyColor.Value = descendant:FindFirstChildWhichIsA(“Color3Value”).Value
end)
if descendant:FindFirstChildWhichIsA(“Color3Value”).Value == bodyColor.Value then
UIStroke.Parent = descendant
end
end
end


For some reason the color will only change one time (when the character is created), but when the bodycolor value will change nothing will happen. Also, the color is not the good color for some reason.