Hi there, I am still working on a player customizer GUI, and I made a hat GUI for it. Well, it was all working perfectly until I can't remember what happened. It does work, yes, but not how I want it. You see, when you press a button, the hat goes on the player, but then disappears. Here's the script:
Player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent Human = Player.Character debounce = true function onClicked(mouse) if debounce == true then debounce = false Hat = Instance.new("Accessory") Handle = Instance.new("Part") Hat.Name = "Hatino" Handle.Name = "Handle" Handle.Parent = Hat Handle.Position = Human:findFirstChild("Head").Position Handle.formFactor = 0 Handle.Size = Vector3.new(1,1,1) Handle.TopSurface = 0 Handle.Locked = true script.Parent.Mesh:clone().Parent = Handle Hat.Parent = Human Hat.AttachmentForward = script.Parent.AttachmentForward.Value Hat.AttachmentPos = script.Parent.AttachmentPos.Value Hat.AttachmentRight = script.Parent.AttachmentRight.Value Hat.AttachmentUp = script.Parent.AttachmentUp.Value wait(1) debounce = true end end script.Parent.MouseButton1Click:connect(onClicked)
Keep in mind that it is in StarterGUI and that it does work but disappears the next second. It's also in a normal script, not local, but I tried making it in local and had the same outcome.