-- Client
CustomiseHolder.Accessories.ChildAdded:Connect(function(accessory)
accessory.Parent = Dummy
accessory:Destroy()
end)
-- Server
RetrieveItem.OnServerEvent:Connect(function(player, assetType, id)
local Item = InsertService:LoadAsset(id)
local Accessory = Item:GetChildren()[1]
local CurrentFolderItem = CustomiseHolder:FindFirstChild(assetType)
if assetType == 'Hats' or assetType == 'Hairs' or assetType == 'Accessories' then
Accessory.Parent = CustomiseHolder.Accessories
end
Item:Destroy()
end)
Basically the server creates the item, and puts it in a folder in RepStorage. The client is then suppose to detect the accessory being added, and then parent it to an NPC, however, I get this warning:
10:44:04.830 - Something unexpectedly tried to set the parent of Ultra-Fabulous Hair Brown to Dummy while trying to set the parent of Ultra-Fabulous Hair Brown. Current parent is Accessories.
10:44:04.830 - Something unexpectedly tried to set the parent of Ultra-Fabulous Hair Brown to NULL while trying to set the parent of Ultra-Fabulous Hair Brown. Current parent is Accessories.
So the item stays in the folder instead of going to the npc (dummy)