andrei012
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 279 |
|
|
| 02 May 2014 11:43 AM |
| Workspace with a bunch of Models with a bunch of Models, and I wanna check every single one of them then i will do what ever i want with the parts using a script? |
|
|
| Report Abuse |
|
|
| |
|
ninja5566
|
  |
| Joined: 14 Jan 2009 |
| Total Posts: 5233 |
|
|
| 02 May 2014 12:33 PM |
model=script.Parent
for _,v in pairs(model:GetChildren()) do --code
or,
model:GetChildren() for i=1,#model do --model[i]... code
but personally I think "for _,v in pairs" is more professional then doing a loop. |
|
|
| Report Abuse |
|
|
andrei012
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 279 |
|
|
| 03 May 2014 12:51 AM |
for i,v in pairs(Workspace:GetChildren()) do if v:IsA("BasePart") then --code-- end if v:IsA("Model") then for o,p in pairs(v:GetChildren()) do if p:IsA("BasePart") then --code-- end end end
??? |
|
|
| Report Abuse |
|
|
andrei012
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 279 |
|
| |
|