1 | script.Parent.MouseButton 1 Down:connect( function () |
2 |
3 | if player.Character:findFirstChild( "Hat" ) then |
4 | player.Character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=20372960" |
5 | else |
6 | local p = Instance.new( "Hat" , player.Character) |
7 | player.Character.Hat.HatTemplate = "http://www.roblox.com/asset/?id=20372960" |
8 | end |
I also want the hat on the characters head. And to my knowledge to make the hat the color I want, I upload a decal with the color I want.
Look at the Wiki article for Hat. They have nothing like a "HatTemplate" property.
Hat objects just contain a single Part named Handle, which will contain the appropriate SpecialMesh with a MeshId. (Play in Play Solo and examine your own Hat objects)
If you don't set the TextureId of the SpecialMesh, it will use the BrickColor of the Part, allowing you to use any color.