I have this code that will make semi-invisible all limbs of a bod, but no accesories (hair, hats, etc) i know that i have to make it with the handle since its impossible to turn an accesory invisible but how could i add it to this script?
game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function(Character) Character.Archivable = true while wait(0.1) do local clonedCharacter = Character:Clone() clonedCharacter.Parent = game.Workspace local delete = clonedCharacter:FindFirstChild("HumanoidRootPart") local Parts = clonedCharacter:GetChildren() for i = 1, #Parts do if Parts[i]:IsA("BasePart") then Parts[i].Transparency = 0.5 Parts.CanCollide = false delete:Destroy() end end end end) end)
We use a for i,v in pairs
game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function(Character) Character.Archivable = true while wait(0.1) do local clonedCharacter = Character:Clone() clonedCharacter.Parent = game.Workspace local delete = clonedCharacter:FindFirstChild("HumanoidRootPart") local Parts = clonedCharacter:GetChildren() for i,v in pairs(Parts) do --Here we use a for loop to get the children of Parts if v:IsA("Accessory") then --Then we check if it is an Accessory then we get the Handle v.Handle.Transparency = 0.5 v.Handle.CanCollide = false elseif v:IsA("BasePart") then --Here we check if it is a basepart v.Transparency = 0.5 v.CanCollide = false end delete:Destroy() end end end) end)