of     1   

SmoothPlastic
#140367989Tuesday, July 15, 2014 2:19 AM GMT

can some give a script that contains "for i,v in pairs' and explain it more than the site does?
KEVEKEV77
#140368153Tuesday, July 15, 2014 2:20 AM GMT

It runs through a table in pairs TABLE = {"hi", "out", "moo"} for i,v in pairs(TABLE) do print(v); end It would print TABLE[whateveritison] OUTPUT: hi out moo
SmoothPlastic
#140368718Tuesday, July 15, 2014 2:26 AM GMT

so basically it prints out every thing in the table for example p = {"moo", "hi", "out"} for i,v in pairs(p) do print(p); end and it would print every thing in "p" right?
lampwnage121
#140368874Tuesday, July 15, 2014 2:27 AM GMT

p = {"moo", "hi", "out"} for i,v in pairs(p) do print(i) print(p) end Test it and find out. i is the variable assigned to the index, v is the variable assigned to the value.
AnonyAnonymous
#140369040Tuesday, July 15, 2014 2:29 AM GMT

It doesn't necessarily have to be "i,v" it can be something like, for Anything,Everything in pairs() do end "Anything" is the numerical order of the "Children" in the table, "Everything" is the actual "Child" of the table. An example would be, ChildTab = {"ChildOne","ChildTwo","ChildThree"} for _,ActualChild in pairs(ChildTab) do print(ActualChild) end That would print every "Child" of the table in order from the first to the last.
SmoothPlastic
#140369051Tuesday, July 15, 2014 2:29 AM GMT

why did you print i?
lampwnage121
#140369534Tuesday, July 15, 2014 2:34 AM GMT

Custom indexes, nil values etc... Dictionary = {"one","two",nil,"four",["Cows"] = "They produce milk",["Chickens"] = "They produce eggs"} for i,v in pairs(Dictionary) do print(i , v) end

    of     1