Accessory not sticking to player

I want to achieve a character customization but I’ve encountered a problem. Whenever I try to add the accessory by clicking the button it will add it to my character but not stick.

I haven’t been able to find a good enough video which would be helpful.

I’ve tried the developer hub, YouTube as well as changing the code multiple times.

script.Parent.MouseButton1Up:Connect(function()
	local AccessoryName = script.Parent:FindFirstChildWhichIsA("Accessory").Name

	if game.Players.LocalPlayer.Character:FindFirstChild(AccessoryName) then
		game.Players.LocalPlayer.Character[AccessoryName]:Destroy()
	else
		game.Players.LocalPlayer.Character.Humanoid:AddAccessory(script.Parent[AccessoryName])
	end
end)

The code above is what I’m currently using, In the past I’ve used this code and It’s worked fine. I’m sorry if the code isn’t the best I haven’t done coding in almost half a year.

I’m stumped, is anyone able to help?

Make sure your accessory is formatted properly. Please send a screenshot of the hierarchy. If it isn’t or you don’t know,
You could use the Roblox avatar plugin “Accessory Fitting Tool”


and simply insert the accessory into the character.

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