|
| 01 Mar 2017 08:40 AM |
I am pretty new to scripting.
How would you get all parts with the same name from the workspace or anywhere else? I know you can use :GetChildren, but after what I know that is read only, and you can't actually change the properties of the things you are looking to work with.
So in this case I have a few parts I want to change, I know I could make a table and give them individual names, but it's just wayy to much. So how do I get all the parts under the same name?
Thanks in advance.
|
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 01 Mar 2017 09:08 AM |
"I know you can use :GetChildren, but after what I know that is read only, and you can't actually change the properties of the things you are looking to work with."
You understood wrong, that is not the case. |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2017 09:14 AM |
So when you use :GetChildren() how do you specify the name of whatever you want? I try doing game.Workspace:GetChildren("LOL") put it doesn't work:
gg = game.Workspace:GetChildren("LOL")
gg.Transparency = 1
|
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 01 Mar 2017 09:16 AM |
| You iterate over the table it returns and check the name of the child. |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2017 09:17 AM |
local gg = game.Workspace:GetChildren()
print(#gg) |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2017 09:17 AM |
| GetChildren doesnt need an argument. |
|
|
| Report Abuse |
|
|