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

How to add a hat, to a NPC?

I know how to insert a hat, and parent it to a Character. But, with NPCs, or just normal models, the Hat doesn't position correctly, and isn't visible. Tips?

game:GetService("InsertService"):LoadAsset(221290585):GetChildren()[1].Parent = game.Workspace.Model

1 comment

0

Did you make joints on the Model?

2 answers

✓ Accepted answer

Thats weird.... it might be because of the humanoid...

It worked for me...

Heres a link to what I did.

http://www.roblox.com/For-Shawnyg-item?id=222610574

Hehe, If you could't get it before, I made it free/Get-able now.

1 comment

0

I anchored the Head which prevented the Hat from going on. Your model made me realize my errors. Thanks!

There is a function on the humanoid called AddAccessory this function can help alot if you want to insert a hat into a NPC or a player.

Something like this:

local hat = game:GetService("InsertService"):LoadAsset(221290585):GetChildren()[1]
script.Parent.Humanoid:AddAccessory(hat)

You must define the Humanoid first before inserting a hat.

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