So in my script I want to get the children (or children's children) of a model which you put on separately which can have a random number of parts, and when you press a button those parts' transparency will become 1. The closest kind of technique to getting the children of an object is :GetDescendants, I use that over GetChildren because its easier to script in. I want to put the :GetDescendants into a function but the only way which the Wiki tells you to do it is by making a script like this.
for index, descendant in pairs(descendants1) do
descendants1.transparency = 1
end
for index, descendant in pairs(descendants2) do
descendants2.transparency = 1
end
for index, descendant in pairs(descendants3) do
descendants3.transparency = 1
end
In summary, I want to put that in a function and make all the children of a model become invisible by using a script.

4 comments
you forgot to use :GetDescendants()
replace script.parent with your reference like game.Workspace.Model:GetDcendents()
I'll try it real quick, do I change "v" to anything?
v is just the variable, if you want to change the name, to say "thingy" change the place where it defines it in this case the pairs loop: for i,thing in pairs