gogo6104
|
  |
| Joined: 10 Feb 2010 |
| Total Posts: 326 |
|
|
| 10 Sep 2016 02:07 PM |
I still don't fully understand how to take use of GetChildren()
How do I make it so the script gets the children of a location and copies an item into each child of that location?
Here's what I did:
location = game.Workspace:GetChildren() for i,e in pairs do script.ExampleItem:Clone().Parent = children end
- Seth (gogo6104) || Developer || GFX Designer |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 02:08 PM |
that is completely wrong
http://wiki.roblox.com/index.php?title=Loops
for _,child in pairs(workspace:getChildren()) do script.ExampleItem:Clone().Parent = child end |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 02:11 PM |
| I normally use ipairs though, since there's less chance of erroring by trying to copy something into a nil object. |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 02:16 PM |
| ^ there wont be a nil object because all references to the object will still exist even if their parent is removed |
|
|
| Report Abuse |
|
|