generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

How do you Check Parts inside a Model?

Previous Thread :: Next Thread 
andrei012 is not online. 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
1234Christopher is not online. 1234Christopher
Joined: 21 Oct 2008
Total Posts: 1715
02 May 2014 11:44 AM
:GetChildren()
Report Abuse
ninja5566 is not online. 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 is not online. 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 is not online. andrei012
Joined: 05 Nov 2010
Total Posts: 279
03 May 2014 06:33 AM
is that right?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image