Boa noite, poderiam me ajudar nesse erro abaixo, quando eu falo hi, para algum npc aparece esse erro, impossibilitando a compra ou venda de itens nele
012-Table.lua -> script
table.find = function (table, value)
for i, v in pairs(table) do
if(v == value) then
return i
end
end
return nil
end
table.contains = function (txt, str)
for i, v in pairs(str) do
if(txt:find(v) and not txt:find('(%w+)' .. v) and not txt:find(v .. '(%w+)')) then
return true
end
end
return false
end
table.isStrIn = table.contains
table.count = function (table, item)
local count = 0
for i, n in pairs(table) do
if(item == n) then
count = count + 1
end
end
return count
end
table.countElements = table.count
table.getCombinations = function (table, num)
local a, number, select, newlist = {}, #table, num, {}
for i = 1, select do
a[#a + 1] = i
end
local newthing = {}
while(true) do
local newrow = {}
for i = 1, select do
newrow[#newrow + 1] = table[a]
end
newlist[#newlist + 1] = newrow
i = select
while(a == (number - select + i)) do
i = i - 1
end
if(i < 1) then
break
end
a = a + 1
for j = i, select do
a[j] = a + j - i
end
end
Pergunta
gabrielbuff 0
Boa noite, poderiam me ajudar nesse erro abaixo, quando eu falo hi, para algum npc aparece esse erro, impossibilitando a compra ou venda de itens nele
012-Table.lua -> script
table.find = function (table, value)
for i, v in pairs(table) do
if(v == value) then
return i
end
end
return nil
end
table.contains = function (txt, str)
for i, v in pairs(str) do
if(txt:find(v) and not txt:find('(%w+)' .. v) and not txt:find(v .. '(%w+)')) then
return true
end
end
return false
end
table.isStrIn = table.contains
table.count = function (table, item)
local count = 0
for i, n in pairs(table) do
if(item == n) then
count = count + 1
end
end
return count
end
table.countElements = table.count
table.getCombinations = function (table, num)
local a, number, select, newlist = {}, #table, num, {}
for i = 1, select do
a[#a + 1] = i
end
local newthing = {}
while(true) do
local newrow = {}
for i = 1, select do
newrow[#newrow + 1] = table[a]
end
newlist[#newlist + 1] = newrow
i = select
while(a == (number - select + i)) do
i = i - 1
end
if(i < 1) then
break
end
a = a + 1
for j = i, select do
a[j] = a + j - i
end
end
return newlist
end
esqueci de argumentar
Link para o comentário
Compartilhar em outros sites
4 respostass a esta questão
Posts Recomendados