Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do you change the transparency of multiple blocks without changing the name?

Asked by 9 years ago

i made a tool but wanna make it so that all the parts are transparent (don't ask why) how do i do it?

2 answers

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

Use the GetChildren method of an object to access a list of the objects inside of it, then iterate through them and change their Transparency.

0
*slap* im such an idiot i was using className WeBuiltOurOwnWorld 6 — 9y
Ad
Log in to vote
0
Answered by
rexbit 707 Moderation Voter
9 years ago

In addition to iwaffle1's answer, the GetChildren method is a read-only table of the given parent's childrens, For Instance.

local Children = workspace:GetChildren() or game.Workspace:GetChildren()

This not be edited with nor Modified, to iterate through it, you'd have to use a iterating function or the Pairs function, Example of layout.

for index,value in pairs(Children) do
    return v
end

The value in the Pairs is a variable of all the Parent's children, and the index is the Current Index, Example of an Index :

local var = 56

for i,v in pairs(var) do
    print(i,v) --> var 56
end
  • Lua
for i = begin,last,increment do

end

Answer this question