Function hat:Attach(humanoid)

Every time a script deals with hats, the programmer has to write his or her own hat weld function, and it’s an eyesore. I was recently reminded of this when I was looking through TheGamer101’s demo of GetCharacterAppearanceAsync, I’ve had to use it whenever I want to have a character/NPC wear a hat, and I know for a fact that every single hat “giver” free model in existence uses a weldHat function to attach the hat to characters. For something so essential for the usage of hats, it would make sense if there was a method to attach hats to characters/NPCs instead of having to write your own function every time you wanted to use hats.

5 Likes

I use local cutscenes in my more recent games, and hats don’t attach to characters within the camera so I have to weld it manually and it’s a small waste of time. So this would be useful!

1 Like

If it’s a player you can do

player:LoadCharacterAppearance(hat object)

otherwise yes, we need this.

I love this idea :D. It would kill time.

I do like this, but I would think a Humanoid would be the one acting on the Hat, not the other way around.

For instance:
http://wiki.roblox.com/index.php?title=API:Class/Humanoid/EquipTool

Humanoid:EquipHat(hat)?

I’m fine with that too – as long as I don’t have to write my own function every time I need to work with hats.

Just came across the need for this again and had to manually weld hat handles to NPCs.

Was searching the forums for info dealing with npc’s and hats and found this thread. I looked on wiki and sure enough this actually exists now. So for future reference, going to post that here in case someone in the future also needs this.

http://wiki.roblox.com/index.php?title=API:Class/Humanoid/AddAccessory

9 Likes