i still have no idea why this isn't considered a valid quesiton because I attempted to do this and nobody wants to help
I've been trying to make a script that, when you click it, you wear a hat. I've tried this script and all it does is create the hat but it doesn't go on your character, and your hats aren't removed. Here's the code:
local pl = game.Players.LocalPlayer local c = pl.Character local debounce = false script.Parent.MouseButton1Up:connect(function() if script.Parent.ImageColor3 == Color3.new("255","255","255") then local d = c:GetChildren() for i=1, #d do if d[i].className == "Hat" then d[i]:remove() end wait(0.1) local helm = game.Lighting:FindFirstChild("Genie") local cl = helm:Clone() cl.Parent = c debounce = true if debounce == true then debounce = false local h = Instance.new("Hat") local p = Instance.new("Part") h.Name = "Hat" p.Parent = h p.Position = c:FindFirstChild("Head").Position p.formFactor = 0 p.Size = Vector3.new(-0,-0,-1) p.BottomSurface = 0 p.TopSurface = 0 p.Locked = true script.Mesh:clone().Parent = p h.Parent = c h.AttachmentPos = Vector3.new(0.125, 1.65, 0.18) -- wait(5) debounce = false end end end end)
Closed as Not Constructive by Goulstem, MessorAdmin, and woodengop
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?