How to add accessories to cloned player character?

How can I efficiently cloned any accessory into a clone of the players character?

With the current method that I am trying, the accessory does clone into the model but does not go to the correct positions. I am trying to figure out how I can make the items go to where they need to be.

For example, the sword is a back item which should go to the back and then the necklace is a neck item which would go to the neck. However when I try to insert these items, they just go to the players head.




Functions["GiveAsset"] = function(id: number, Mannequin: Model)
	--will create and give a requested id to the mannequin
	local activeMaids = vars["activeMaids"];
	local ClothingMaid = activeMaids["ClothingMaid"];

	local newAsset = InsertService:LoadAsset(id)
	if #newAsset:GetChildren() > 0 then
		local Asset = newAsset:GetChildren()[1]; --because insert service is a model with the accessory INSIDE of it.
		Asset:SetAttribute("ID", id)
		Asset:SetAttribute("AddedAccessory", true)
		
		--TODO TODO TODO figure out how to place items correctly.
		local humanoid = Mannequin:FindFirstChildOfClass("Humanoid")
		if humanoid then
			humanoid:AddAccessory(Asset)
		else
			Asset.Parent = Mannequin
		end
		
		ClothingMaid:GiveTask(Asset)
	end

	task.wait()
	newAsset:Destroy() --destroy parent model.
end

I think you may have removed all attachments of the Character somewhere inside your script

I dont think so because all I did was Plr.Character:Clone(). My mannequins have humanoids within them as well.

Functions["CharacterAdded"] = function(Chr)
     local fullCharacter = Chr;
     fullCharacter.Archivable = true
     fullCharacter:Clone().Parent = game.Workspace
end

Actually you are correct. I am using a model without attachments within it which is why my accessories would not be placing correctly. I switched it out for a model with attachments and it works. Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.