Hi I have a script where if you touch the part you will become transparent for 5 seconds and reappear again, but for some reason accessories won't become transparent with the rest.
function setTransparency(char, value)
for _, child in pairs(char:GetChildren()) do
if child:IsA('Accessory') and child:FindFirstChild("Handle") then
child = child.Handle
elseif child:IsA('BasePart') and child.name ~= "HumanoidRootPart" then
child.Transparency = value
end
end
end
local enabled = true
game.Workspace.TransPart.Touched:connect(function(hit)
local char = hit.Parent
if char then
local head = char:FindFirstChild("Head")
local face = head:FindFirstChild("face")
if enabled and head and game.Players:GetPlayerFromCharacter(char) then
enabled = false
for t = 0, 1, 1 do
if face then face.Transparency = t end
setTransparency(char, t)
wait(0.1)
end
wait(5)
for t = 1, 0, -1 do
if face then face.Transparency = t end
setTransparency(char, t)
wait(0.1)
end
wait(1)
enabled = true
end
end
end)

2 comments
Thank you so much for the answer!
No problem :)