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

How to I make a players accessories invisible?

I made all the players transparent but I want to make their accessories transparent too. I don't want to destroy it because at a point, I would make them opaque. I don't know the code to add to make the accessories disappear because the accessories have no property that makes them disappear.

for _, player in pairs(game.Players:GetPlayers()) do
	local p = player.Character
	if p.Child:IsA("Part") or p. Child:IsA("MeshPart") then
	p.Child.Transparency = 1
end

1 comment

0

Why not delete it?

1 answer

✓ Accepted answer

###You would have two for loops, the first one looping through the players and the other one looping through the character's descendants. Don't check for specific classes, like you did on line 3.

for _, player in pairs(game.Players:GetPlayers()) do
    local character = player.Character
    
    for _, descendant in pairs(character:GetDescendants()) do
        if descendant:IsA("BasePart") then -- if it is a part in general
            descendant.Transparency = 1
        end
    end
end

###Inheritance is a powerful thing.

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