How can I modify this script in order for everything inside "Pieces" to change Transparency, when the Transparency inside "Bags" are all zero. There are six bags in total inside the "Bags" model, they don't change transparency altogether as it requires the player to get in contact with the bags.
local bags = script.Parent.Bags:GetChildren()
local pieces = script.Parent.Pieces:GetChildren()
for i,bags in pairs(bags) do
if bags.Transparency == 0 then
print("all bags are visible...")
for i,pieces in pairs(pieces) do
pieces.Transparency = 0
print("puzzle pieces are visible...")
end
end
end

1 comment
My issue is that, the pieces don't change transparency at all even though the transparency inside "Bags" are all 0.