Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I want a player to get a hat when they select on a Gui. What did I do wrong?

Asked by 9 years ago

script.Parent.MouseButton1Down:connect(function() if player.Character:findFirstChild("Hat") then player.Character.Pants.PantsTemplate="http://www.roblox.com/asset/?id=20372960" else local p = Instance.new("Hat", player.Character) player.Character.Hat.HatTemplate="http://www.roblox.com/asset/?id=20372960" 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.

1 answer

Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
9 years ago

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.

Ad

Answer this question