#Pairs Loops

7 messages · Page 1 of 1 (latest)

mortal rampart
#

hi, im new to scripting and i don't understand how Pairs Loops works.

#

this is script i made from tutorial but i don't understand what means i, v

void tusk
#

First, you dont need the "(" and ")" at first line
Scnd: What are you trying to do?

mortal rampart
valid path
#

you don't really need pairs and ipairs

#

like

array = {
  [1]="h",
  [2]="e",
  [3]="l",
  [4]="l",
  [5]="o"
}

for i,v in array do
  print(i,v)
end

-- will print
1 h
2 e
3 l 
4 l 
5 o 


void tusk
#

Im teaching him, I got this