This is a hat customizer GUI script, and because of the recent change from hat to accessory it doesn't seem to work. How do I fix it? Or is there a better way of doing it?

bin = script.Parent
Accessory = bin:WaitForChild("Accessory")
	AccessoryID = Accessory:WaitForChild("AccessoryID")
	TextureID = Accessory:WaitForChild("TextureID")
	AccessoryCon = Accessory:WaitForChild("Confirm")
	
Deb = {
	Accessory = true,
}
-- Accessory Module

AccessoryCon.MouseButton1Click:connect(function()
	if Deb.Accessory then Deb.Accessory = false
		local ID = AccessoryID.TextBox.Text
		local Texture = TextureID.TextBox.Text
		local NewAccessory = game:GetService("InsertService"):LoadAsset(ID):GetChildren()
		if #NewAccessory == 1 then
			if NewAccessory[1].ClassName == "Accessory" then
				if Texture ~= "" then
					NewAccessory[1].Handle.Mesh.TextureId = "http://www.roblox.com/asset/?id="..Texture-1
				end
				NewAccessory[1].Parent = game.Players.LocalPlayer.Character
			end
		end
		
	Deb.Accessory = true
	end
end)

This is a local script inside a Frame, that's inside another Frame that's in a ScreenGui. The Frame above the Frame of the local script has a local script of it's own. I don't think it affects this script though.

3 comments

1

Really? This looks like it works with Accessories. Are there any errors?

0

The thing is, it actually works in test mode in studio, but not when you play the game.

0

Ive tried moving it to a new, blank place. It worked in test studio but still not in the actual game, so I don't think it's any scripts outside of this GUI that are blocking it. I used the GUI to try and insert a hat in-game and in the developer console it showed this error: ''exception while signaling: InsertService.AllowClientInsertModels set to false insert failed for asset [hat ID] ''.