Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I change the head colour?

So im making character customization like I always do and fail at every 5 months or so and I got this skin changer from toolbox, it actually works but the scripting looks sort of odd. I've tried to replace Skin With HeadColour as thats what its called in the Body_Colors part in each character

function OnTouch(hit)
a = hit.Parent:FindFirstChild("Humanoid")
skiny = hit.Parent:FindFirstChild("Skin")
if (skiny == true) then return end
	local skin = Instance.new("Skin")
	skin.SkinColor = script.Parent.BrickColor
	skin.Parent = hit.Parent
end
script.Parent.Touched:connect(OnTouch)

I've also tried using different variables but that doesnt really help either

1 answer

If this isn't working for you, use a HumanoidDescription.

A HumanoidDescription is an Instance that contains information on how a Humanoid should appear. The properties of a HumanoidDescription do include the colors of the legs, arms, head, and torso. For the head, this property is HeadColor and is a Color3.

To set a HumanoidDescription to a Humanoid, you must use Humanoid:ApplyDescription(HumanoidDescription). Once applied, the Humanoid will take the appearance of the information given in the HumanoidDescription.

If you don't want to create the description from scratch, you can use Humanoid:GetAppliedDescription() to get the current description and then edit the HeadColor of that description. If the change is not immediately applied, you'll need to use Humanoid:ApplyDescription() on the obtained description (plus the edited HeadColor).

This discussion is preserved as it was. New answers, comments, and votes are closed.