Attaching hats to a dummy from client

So I’ve got a system in place which inserts a players hats from the server and chucks them in a folder. Then from the client, I get those hats from the folder, and throw them into a dummy. However, when parenting the hats to the dummy, they don’t actually get attached like I hat normally would.

for _, v in pairs(CustomiseStorage:GetChildren()) do
	if v:IsA('Decal') then -- Face
		v.Parent = Dummy.Head
	else -- Hats/Hair/etc
		v.Parent = Dummy
	end
end

Please note, I cannot use HumanoidDescription. Please do not bring it up. It will not work. End of story.

1 Like

Hint


Try this method using the Humanoid.

Checks

  • Unanchor the accessory handle.
  • Make sure you have attachments inside the accessories’ handles paired with correct attachment.
    • Attachment needs to be positioned correctly.

Code


Changed like this:

for _, v in pairs(CustomiseStorage:GetChildren()) do
	if v:IsA('Decal') then -- Face
		v.Parent = Dummy.Head
	else -- Hats/Hair/etc
		Dummy.Humanoid:AddAccessory(v)
	end
end

Oh, and appears there are no humanoids.

1 Like


Each Handle.Anchored is set to false.

Each Handle has their appropriate Attachment.

The accessories were added in using InsertService:LoadAsset() from the server

for _, v in pairs(CustomiseStorage:GetChildren()) do
	if v:IsA('Decal') then
		v.Parent = Dummy.Head
	else
		Dummy.Humanoid:AddAccessory(v)
	end
end

There appears to be no humanoid, so you will have to fix the humanoid instead.

Huh?? There is a Humanoid. Inbetween the accessories

There is a Humanoid. Right Below the Empyrean Reignment accessory.

Something you could try is manually welding the accessory on, maybe something like this:

for _, v in CustomiseStorage:GetChildren() do
    if v:IsA("Decal") then
        v.Parent = Dummy.Head
    else
        local attach0 = v.Handle:FindFirstChildWhichIsA("Attachment")
        local attach1 = Dummy:FindFirstChild(attach0.Name,true)
        local weld = Instance.new("Weld")
        weld.Parent = v.Handle
        weld.Part0 = attach0.Parent
        weld.Part1 = attach1.Parent
        weld.C0 = attach0.CFrame
        weld.C1 = attach1.CFrame
        v.Parent = Dummy
    end
end

@NinjoOnline Just tested it, it works!

8 Likes