Head not Changing Color

I’m currently making colored pads that are supposed to change the player’s skin color to the pad’s color, but for some reason, the head does not change color. Here’s the script and result.

Script
script.Parent.Touched:Connect(function(hit)
for i, v in pairs(hit.Parent:GetChildren()) do
	v.BrickColor = script.Parent.BrickColor
end
end)
Result

WARNING: Video may not be suitable for some people.
robloxapp-20200812-1241583.wmv
My apologies for the video being a download.

If you know how to fix this problem, or to make that video a non-download, then please let me know in a post! :grin:

You can use the BodyColors object inside the player’s character and set the color properties to the BrickColor of said part. So instead,

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local BodyColors = hit.Parent:FindFirstChild("Body Colors")
        BodyColors.HeadColor = script.Parent.BrickColor
        -- repeat the process for the rest of the parts
    end
end)

try to put BrickColor.new()

script.Parent.Touched:Connect(function(hit)
for i, v in pairs(hit.Parent:GetChildren()) do
	v.BrickColor = BrickColor.new(script.Parent.BrickColor)
end
end)

Is thrre a way to use for i, v in pairs to change the color of all of the humanoid’s body parts?

There’s a property for every body part.

To make the video a non-download, use Gyazo.com. To solve your problem, there is an object in the player called BodyColors. You can change the properties of that to change the player’s body color.

1 Like