Making a accesory handle turn invisbile

So i am trying to make the hair turn full transparent but it is not turning transparent how can i fix

local DestroyHair = {}
function DestroyHair:Destroy(Char)
    for i,v in pairs(Char:GetChildren()) do
        if v:IsA("Accessory") then
            if v:FindFirstChild("Handle") then
                v.Transparency = 1
                end
            end
        end
    end
return DestroyHair
1 Like

Destroying their hair, if you want to delete it then

v:Destroy()

If you’re not destroying it then move it to the player and when you’re done move it back to the character.

2 Likes

i did this and it worked

local DestroyHair = {}
function DestroyHair:Destroy(Char)
	for i,v in pairs(Char:GetChildren()) do
		if v:IsA("Accessory") then
			if v:WaitForChild("Handle") then
				v.Handle.Transparency = 1
				end
			end
		end
	end
return DestroyHair
```
1 Like

nvm lol it just broke out of nowhere

1 Like

EDIT:

Seems like you’ve already done what I just posted. I’ll get back to you since apparently you’re still have trouble.

1 Like
local DestroyHair = {}
function DestroyHair:Destroy(Char)
    for i,v in pairs(Char:GetDescendants()) do
        if v:IsA("Accessory") then
               v:Destroy()
            end
        end
    end
return DestroyHair

make sure the call the function

2 Likes

i did and it works now thank you guys

I don’t know why but everytime I try to help someone with a function, their problem is always calling it, and I always overlook it bruh.

oof lol the only problem im getting now is when i die the stuff reappears

Add this function

game.Players.CharacterAdded:Connect(function(character)
   --Code from the game.Players.Character added inside of this insteal of the game.playersadded function
end)

oh wait THis one

local DestroyHair = {}
function DestroyHair:Destroy(Char)
	print("destroy hair module line 2 ranned")
	for i,v in pairs(Char:GetChildren()) do
		if v:IsA("Accessory") then
			print("destroy hair module line 6 ranned")
			if v:WaitForChild("Handle") then
				print("destroy hair module line 10 ranned")
				v.Handle.Transparency = 1
				print("destroy hair module line 12 ranned")
			end
		end
	end
end
return DestroyHair

that is a module that is being called

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Char)
end)
end)