Jump to content
Sign in to follow this  
Sinister

Somar Valores de Tabelas

Recommended Posts

Sinister    0
Sinister

SCRIPT:

table.add = function(t1, t2, t3)
   for _, valor in pairs(t1) do
       table.insert(t3, valor)
   end
   for _, valor in pairs(t2) do
       table.insert(t3, valor)
   end
end

funciona assim:

table.add = function(t1, t2, t3)

for _, valor in pairs(t1) do

table.insert(t3, valor)

end

for _, valor in pairs(t2) do

table.insert(t3, valor)

end

end

local table1 = {"Demon"}

local table2 = {"Rat"}

local table3 = {}

table.add(table1, table2, table3)

Dai, usando o printTable do Kaotar, vai printar {Demon, Rat}

Agradeçimentos especiais: Notorious, e Kaotar (adorei o printTable, to usando todo dia '0')

Edited by Mickfern

Share this post


Link to post
Share on other sites
tigerx2    1
tigerx2

haha, assim facilita muito,

/alguns scripts eh claro

e me ajudou bastante..

valeu ae manolols

att~

tigerx2

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×