title says it all, ik this is not a request site but i tried my best and i could not do it
This is technically made a fixed version of what blowup999 typed in his answer. Click here to learn about GetAccessories. Click here to see about Instance.new (Using the second argument in Instance.new is bad practice and takes a lot of computer power for it to work), even the wiki says that you shouldn't use the second argument when using the Instance.new. Plus I simplified the UserInputService event to a simple MouseButton1Click event.
local plr = game.Players.LocalPlayer local char = plr.Character local hum = char:WaitForChild("Humanoid") local tb = Instance.new("TextButton") tb.Parent = plr:WaitForChild("PlayerGui") tb.MouseButton1Click:Connect(function() for _,v in pairs(hum:GetAccessories()) do v:Destroy() end end)
Should be in a localscript, tell me if it doesn't work and read about UserInputService for how it tells when click started
local plr = game.Players.LocalPlayer local tb = Instance.new("TextButton", plr.PlayerGui) tb.InputBegan:Connect(function(key) if key.UserInputType == Enum.UserInputType.MouseButton1 then for i,v in pairs(plr.Character:GetChildren()) do if v:IsA("Accessory) then v:Destroy() end end end end)
Closed as Non-Descriptive by hiimgoodpack and PyccknnXakep
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?