I'm trying to find all the children of some folders and change their Transparency and CanColide depending on a variable.
local descendants = game.Workspace:GetDescendants()--Change the game.workspace to your model. for index, descendant in pairs(descendants) do if descendant:IsA("Part") then descendant.CanCollide = false descendant.Transparency = 0.4 end end
Using descendants you can basically get all the Parts/children in the model to modify.
local parts = game.workspace.Model:GetChildren() -- change to your model if parts.CanCollide == true or parts.Transparency == 0 then game.workspace.Model.WaitForChild() parts.CanCollide = false parts.Transparency = 1 end
Closed as Not Constructive by hiimgoodpack and VitroxVox
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?