How would i make a custom accessory inserter?

image
When you presss Custom accessory after inserting, i want it to get the id inserted and put it on the character.
How would i go about doing that?

1 Like

So i came up with something quick, it inserts the accessory, but it does it in a model. How would i take the accessory out?

(my script:)

local event = Instance.new("RemoteEvent")
event.Name = "CustomAccessoryEvent"
event.Parent = game.Workspace["Events"]["TheEvents"]
event.OnServerEvent:connect(function(player, liger,WhatToAdd)
	
------------------- The Script.
	local assetId = WhatToAdd
	local InsertService = game:GetService("InsertService")
	
	local getItemInfo = game:GetService('MarketplaceService');
	local creator = getItemInfo:GetProductInfo(WhatToAdd).Creator.Id;
	local assetT = getItemInfo:GetProductInfo(WhatToAdd).AssetTypeId;
	if assetT == 42 or assetT == 8 or assetT == 43 or assetT == 46 or assetT == 45 or assetT == 44 or assetT == 47 then
		local a = InsertService:LoadAsset(assetId)
		a.Parent = liger
	end
1 Like

The easiest way would be to use Model:FindFirstChildWhichIsA("Accessory"), and then use the Humanoid:AddAccessory() function on the player’s humanoid once you’ve gotten the accessory object.

1 Like

Thanks for the answer, heres a screenshot to explain it better.

1 Like