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
 

Re: GetChildren?

Previous Thread :: Next Thread 
Flosky is not online. Flosky
Joined: 15 May 2011
Total Posts: 1815
05 Jun 2013 05:17 PM
I'm now learning about this function, so I went into LuaLearners, and they gave me this code.

g = game.Workspace:GetChildren()

for i = 1, #g do
if g[i].ClassName == "Part" then
g[i].CFrame = CFrame.fromEulerAnglesXYZ(.9, .9, .9)
end
end

I tested it, well changed it to this so it'd be easier for me to test with.

g = game.Workspace:GetChildren()

for i = 1, #g do if g[i].ClassName == "Yup" then
g[i].Transparency = 1
end
end

And the Brick in Workspace names "Yup" didn't become transparent, it wouldnt even rotate with the original script. Does anyone know why? And yes I'm putting it into Workspace.
Report Abuse
toadjesse is not online. toadjesse
Joined: 03 Jun 2008
Total Posts: 5617
05 Jun 2013 05:18 PM
Replace "g[i].ClassName" with g[i].Name
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
05 Jun 2013 05:19 PM
ClassName is the name of the class, not the part itself. So if it is a brick the className is always Part. Do g[i].Name == "Yup"
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
05 Jun 2013 05:19 PM
Because there's probably nothing in Workspace with the ClassName of Yup.

if g[i].Name == "Yup" then
Report Abuse
Flosky is not online. Flosky
Joined: 15 May 2011
Total Posts: 1815
05 Jun 2013 05:23 PM
Ohhh that makes sense! Thanks!
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