|
| 02 Sep 2012 11:10 PM |
| More like stupid question.. But what is the "for _," And so on? I have no clue what the name is-Let alone how to do it. Please send me the link from wiki if applicable. |
|
|
| Report Abuse |
|
|
|
| 02 Sep 2012 11:25 PM |
for [parent], [items] in pairs do
both names can be anything, its not have to be "__" its a short cut for...
a=model:GetChildren() for i=1,#a do |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 02 Sep 2012 11:28 PM |
@the purple, doing it wrong
for _, v in pairs(Workspace:GetChildren()) do it gets all of the children from workspace. You can change _ and v to anything you would like
~Don't get mad as to what I said, get mad at me as a person |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 02 Sep 2012 11:41 PM |
tab = {"Hello","Hi","Hey"} for i,v in pairs(tab) do print(v) end
Pretty much all that does is iterate through everything in the table and print it out. The i is the index and v is the value. If I said
print(i)
then it would print all the indexes in the table. |
|
|
| Report Abuse |
|
|
|
| 02 Sep 2012 11:43 PM |
http://wiki.roblox.com/index.php/Function_Dump/Core_Functions%23pairs
~ Moo logic = logical logic ~ |
|
|
| Report Abuse |
|
|