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

How would I go about inserting a hat onto someone using scripts?

Title, tried to use scripts to put a hat on someone, it connected strangely.

My friend told me to weld a part onto their head (with a hat mesh), could anyone possibly tell me how to do that or link me to a page, it would be greatly appreciated.

1 answer

Clone the Hat object into a character, or you can create the hat object the put the parts and all the properties needed for the hat.

Create Hat Example: (This is from a free model btw)

h = Instance.new("Hat")
p = Instance.new("Part")
h.Name = "Americasweetheart"
p.Parent = h
p.Position = hit.Parent:findFirstChild("Head").Position
p.Name = "Handle" 
p.formFactor = 0
p.Size = Vector3.new(1,1,2) 
p.BottomSurface = 0 
p.TopSurface = 0 
p.Locked = true 
script.Parent.Mesh:clone().Parent = p
h.Parent = hit.Parent
h.AttachmentForward = Vector3.new(-0, -0, -1)
h.AttachmentPos = Vector3.new(0, 1.15, -0.05)
h.AttachmentRight = Vector3.new(1, 0, 0)
h.AttachmentUp = Vector3.new(0, 1, 0)
~~~~~~~~~~~~~~~~

If I helped please set me as the answer and vote me up!

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