#How to make an hat/accessories remover part with Click?
1 messages · Page 1 of 1 (latest)
make a anchored part, add a clickdetector to it and keep it named the same way, then add a script inside and add this code:
local click = script.Parent.ClickDetector
click.MouseClick:Connect(function(plr:Player)
local character = plr.Character
for _, accessory:Accessory in character:GetChildren() do
if accessory:IsA("Accessory") then
if accessory.AccessoryType == Enum.AccessoryType.Hat then
accessory:Destroy()
end
end
end
end)
this code will destroy all hat accessories of players that click on the clickdetector
if you want, i can make another version that destorys hair too or destroys all accessory regardless of accessory type