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
|
  |
| Joined: 03 Jun 2008 |
| Total Posts: 5617 |
|
|
| 05 Jun 2013 05:18 PM |
| Replace "g[i].ClassName" with g[i].Name |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 15 May 2011 |
| Total Posts: 1815 |
|
|
| 05 Jun 2013 05:23 PM |
| Ohhh that makes sense! Thanks! |
|
|
| Report Abuse |
|
|