player=game.Players.LocalPlayer script.Parent.MouseButton1Down:connect(function() if player.Character:findFirstChild("Head") then player.Character.Head.BrickColor = "Pastel brown" else local h = Instance.new("Head", player.Character) h.Head.BrickColor ="Pastel brown" end end)
This is what I put into a local script in a gui.
The problem with your code is on line 9 where you attempted to create an Invalid Instance 'Head'. Head isn't a valid instance type
But alternatively, instead of coloring each limb individually why don't you use a loop to iterate through all the children of the player's character.. then changing any parts(potential limbs)'s colors to the specified color?
local plr = game.Players.LocalPlayer local color = BrickColor.new('Pastel brown') script.Parent.MouseButton1Down:connect(function() if plr.Character then for i,v in pairs(plr.Character:GetChildren()) do if v:IsA('BasePart') then v.BrickColor = color end end end end)