Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

can't remove accessory (FE)?

this is a > local script inside of a button, when the button is clicked, it's supposed to remove the player's hats (accessories).

local player = game.Players.LocalPlayer 
local char = player.Character
script.Parent.MouseButton1Down:Connect(function()
local character = char:FindFirstChild("Humanoid").Parent
for _, acces in ipairs(character:GetChildren()) do
	if acces.ClassName == "Accessory" then
		acces:Destroy()
	end
end
end)

1 comment

0

Have you tried using a RemoteEvent? Usually those work, especially for FE.

1 answer

✓ Accepted answer

###You don't need a for loop to do this.

local player = game.Players.LocalPlayer 
local char = player.Character or player.CharacterAdded:Wait()

script.Parent.MouseButton1Click:Connect(function()
    char.Humanoid:RemoveAccessories()
end)

1 comment

0

didn't know there's such thing as "RemoveAccessories()", thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.