Jump to content

Como se usa el "i, v in pairs"?


Soren

Recommended Posts

local iPairsTable = 
    { 
        "Hello", 
        "World!" 
    } 
     
local pairsTable = 
    { 
        ["h"] = "Hello", 
        ["w"] = "World!" 
    } 
     
for index, text in ipairs ( iPairsTable ) do 
    outputChatBox ( text ) 
end 
  
for code, text in pairs ( pairsTable ) do 
    outputChatBox ( code ..": ".. text ) 
end 

Link to comment
local iPairsTable = 
    { 
        "Hello", 
        "World!" 
    } 
     
local pairsTable = 
    { 
        ["h"] = "Hello", 
        ["w"] = "World!" 
    } 
     
for index, text in ipairs ( iPairsTable ) do 
    outputChatBox ( text ) 
end 
  
for code, text in pairs ( pairsTable ) do 
    outputChatBox ( code ..": ".. text ) 
end 

Que se supone que deberia de hacer eso?

mandar un chatbox?

Link to comment
local pairsTable = 
    { 
        ["h"] = "Hello", 
        ["w"] = "World!" 
    } 
  
for code, text in pairs ( pairsTable ) do 
    outputChatBox ( code ..": ".. text ) 
end 

Ok esto resuelve mi duda de como usar el

in pairs">pairs 

pero todavia no se como usar el

for i, v 

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...