Ir para conteúdo

Featured Replies

Postado

boa noite, alguem poderia me ajudar quando eu falo hi, trade, o npc não responde e apresenta o seguinte erro abaixo

Script 012-table.lua

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

 

erro.png

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo