JS

[Resolvido] [PEDIDO] NPC que vende itens em troca de x quantidades de storage

Por JS Lotus, 17 de out. de 2018 em Resolvidos

24
6.5k
GniusPG
20 de outubro de 2018 às 22:16

Aqui esta, coloquei só um item do id 15060 você só precisa alterar a storage, caso funcione eu coloco outros items

npcstorage.lua

MarshmelloM
20 de outubro de 2018 às 22:24
14 minutos atrás, JS Lotus disse:

Funcionou quase perfeitamente, o NPC está checando a quantidade, entregando o item normalmente, mas pelo que vi, quando você compra algum item a quantidade de storage e é sentada para 0, então se o player quiser comprar mais de um item e tiver por exemplo 30 quantidades, após comprar um ele some, tem como consertar isso? Ajudaria bastante

21 minutos atrás, GniusP disse:

Fiz uma variavel com a qnt que vai ser cobrado e qnt que vai perde , ver se e assim

Spoiler

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                    npcHandler:onThink()                    end

function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
------------------- Configuração dos Itens -----------------------

local items = {1820, 1821, 2037, 2038, 2397, 2398, 2396, 2399, 2400, 11454} -- ID dos Itens
local nome = {'nome 1', 'nome Y', 'nome', 'nome', 'nome', 'nome', 'nome', 'nome', 'nome', 'nome'}  -- Nome dos Itens
local valor = {2145, 25} -- id da moeda, quantidade

------------------- MESSAGES INICIAIS ----------------------------------------
if msgcontains(msg, nome[1]) then
selfSay('Deseja comprar um {'..getItemNameById(items[1])..'} Por X Storage', cid)
talkState[talkUser] = 1

elseif msgcontains(msg, nome[2]) then
selfSay('Deseja comprar um {'..getItemNameById(items[2])..'} Por X Storage', cid)
talkState[talkUser] = 2

elseif msgcontains(msg, nome[3]) then
selfSay('Deseja comprar um {'..getItemNameById(items[3])..'} Por X Storage', cid)
talkState[talkUser] = 3

elseif msgcontains(msg, nome[4]) then
selfSay('Deseja comprar um {'..getItemNameById(items[4])..'} Por X Storage', cid)
talkState[talkUser] = 4

elseif msgcontains(msg, nome[5]) then
selfSay('Deseja comprar um {'..getItemNameById(items[5])..'} Por X Storage', cid)
talkState[talkUser] = 5

elseif msgcontains(msg, nome[6]) then
selfSay('Deseja comprar um {'..getItemNameById(items[6])..'} Por X Storage', cid)
talkState[talkUser] = 6

elseif msgcontains(msg, nome[7]) then
selfSay('Deseja comprar um {'..getItemNameById(items[7])..'} Por X Storage', cid)
talkState[talkUser] = 7

elseif msgcontains(msg, nome[8]) then
selfSay('Deseja comprar um {'..getItemNameById(items[8])..'} Por X Storage', cid)
talkState[talkUser] = 8

elseif msgcontains(msg, nome[9]) then
selfSay('Deseja comprar um {'..getItemNameById(items[9])..'} Por X Storage', cid)
talkState[talkUser] = 9

elseif msgcontains(msg, nome[10]) then
selfSay('Deseja comprar um {'..getItemNameById(items[10])..'} Por X Storage', cid)
talkState[talkUser] = 10

elseif (msgcontains(msg, 'trade') or msgcontains(msg, 'hi')) then
selfSay(' Digite qual item deseja adquirir.', cid)
selfSay('Atualmente temos {'..getItemNameById(items[1])..'}, {'..getItemNameById(items[2])..'}, {'..getItemNameById(items[3])..'}, {'..getItemNameById(items[4])..'}, {'..getItemNameById(items[5])..'}, {'..getItemNameById(items[6])..'}, {'..getItemNameById(items[7])..'}, {'..getItemNameById(items[8])..'}, {'..getItemNameById(items[9])..'} e {'..getItemNameById(items[10])..'}.', cid)
talkState[talkUser] = 0

---------------------- NEGOCIAÇÃO -------------------------------

elseif talkState[talkUser] == 1 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[1], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[1])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 2 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[2], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[2])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 3 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[3], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[3])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 4 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[4], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[4])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 5 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[5], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[5])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 6 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[6], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[6])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 7 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[7], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[7])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 8 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[8], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[8])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 9 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[9], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[9])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 10 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[10], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[10])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

JS LotusJ
20 de outubro de 2018 às 23:12
47 minutos atrás, Marshmello disse:

Fiz uma variavel com a qnt que vai ser cobrado e qnt que vai perde , ver se e assim

  Ocultar conteúdo

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                    npcHandler:onThink()                    end

function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
------------------- Configuração dos Itens -----------------------

local items = {1820, 1821, 2037, 2038, 2397, 2398, 2396, 2399, 2400, 11454} -- ID dos Itens
local nome = {'nome 1', 'nome Y', 'nome', 'nome', 'nome', 'nome', 'nome', 'nome', 'nome', 'nome'}  -- Nome dos Itens
local valor = {2145, 25} -- id da moeda, quantidade

------------------- MESSAGES INICIAIS ----------------------------------------
if msgcontains(msg, nome[1]) then
selfSay('Deseja comprar um {'..getItemNameById(items[1])..'} Por X Storage', cid)
talkState[talkUser] = 1

elseif msgcontains(msg, nome[2]) then
selfSay('Deseja comprar um {'..getItemNameById(items[2])..'} Por X Storage', cid)
talkState[talkUser] = 2

elseif msgcontains(msg, nome[3]) then
selfSay('Deseja comprar um {'..getItemNameById(items[3])..'} Por X Storage', cid)
talkState[talkUser] = 3

elseif msgcontains(msg, nome[4]) then
selfSay('Deseja comprar um {'..getItemNameById(items[4])..'} Por X Storage', cid)
talkState[talkUser] = 4

elseif msgcontains(msg, nome[5]) then
selfSay('Deseja comprar um {'..getItemNameById(items[5])..'} Por X Storage', cid)
talkState[talkUser] = 5

elseif msgcontains(msg, nome[6]) then
selfSay('Deseja comprar um {'..getItemNameById(items[6])..'} Por X Storage', cid)
talkState[talkUser] = 6

elseif msgcontains(msg, nome[7]) then
selfSay('Deseja comprar um {'..getItemNameById(items[7])..'} Por X Storage', cid)
talkState[talkUser] = 7

elseif msgcontains(msg, nome[8]) then
selfSay('Deseja comprar um {'..getItemNameById(items[8])..'} Por X Storage', cid)
talkState[talkUser] = 8

elseif msgcontains(msg, nome[9]) then
selfSay('Deseja comprar um {'..getItemNameById(items[9])..'} Por X Storage', cid)
talkState[talkUser] = 9

elseif msgcontains(msg, nome[10]) then
selfSay('Deseja comprar um {'..getItemNameById(items[10])..'} Por X Storage', cid)
talkState[talkUser] = 10

elseif (msgcontains(msg, 'trade') or msgcontains(msg, 'hi')) then
selfSay(' Digite qual item deseja adquirir.', cid)
selfSay('Atualmente temos {'..getItemNameById(items[1])..'}, {'..getItemNameById(items[2])..'}, {'..getItemNameById(items[3])..'}, {'..getItemNameById(items[4])..'}, {'..getItemNameById(items[5])..'}, {'..getItemNameById(items[6])..'}, {'..getItemNameById(items[7])..'}, {'..getItemNameById(items[8])..'}, {'..getItemNameById(items[9])..'} e {'..getItemNameById(items[10])..'}.', cid)
talkState[talkUser] = 0

---------------------- NEGOCIAÇÃO -------------------------------

elseif talkState[talkUser] == 1 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[1], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[1])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 2 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[2], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[2])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 3 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[3], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[3])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 4 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[4], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[4])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 5 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[5], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[5])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 6 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[6], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[6])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 7 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[7], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[7])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 8 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[8], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[8])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 9 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[9], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[9])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

elseif talkState[talkUser] == 10 then
if (msgcontains(msg, 'sim') or msgcontains(msg, 'yes')) then
local qnt = 10
    if getPlayerStorageValue(cid, 5984548) >= qnt then
        setPlayerStorageValue(cid, 5984548, -qnt)
        doPlayerAddItem(cid, items[10], 1)
        selfSay('Parabens, voce acaba de adquirir um '..getItemNameById(items[10])..'.', cid)
    else
        selfSay('Voce nao tem Storage o suficiente.', cid)
    talkState[talkUser] = 0
    end
end

end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Funcionou, muito obrigado!

1 hora atrás, GniusP disse:

Aqui esta, coloquei só um item do id 15060 você só precisa alterar a storage, caso funcione eu coloco outros items

npcstorage.lua

Opa, quando eu chegar em casa testo e aviso, muito obrigado!

GniusPG
20 de outubro de 2018 às 23:40
Melhor resposta

 

Colega passei algumas horas da madrugada fazendo esse script, creio que ficou do jeito que você pediu.

Trade Window(janela de trade) ✔️

Player precisa ter x quantidade de storage para trocar por x item✔️

Storage é removida conforme a quantidade necessária(você pode configurar as quantidade de storage para cada item)✔️

Abaixo o script e um print de como ficou

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local shopWindow = {}
local t = {
 [2160] = {quant = 15}, -- item e a quantidade de storage que o player precisa
 [11447] = {quant = 13},-- item e a quantidade de storage que o player precisa
 [12345] = {quant = 1}-- item e a quantidade de storage que o player precisa
 }
 local storage = 120760733465 -- storage que o player precisa para trocar o item
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
 if getPlayerStorageValue(cid, storage) >= t[item].quant then
selfSay("Voce trocou "..t[item].quant.." storage por um {"..getItemNameById(item).."}", cid)
doPlayerAddItem(cid,item,1) -- item e a quantidade que o player vai ganhar
setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) - t[item].quant)
else
selfSay("Voce nao tem "..t[item].quant.. " storage para trocar por {"..getItemNameById(item).."}", cid)
  end
return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, buy = ret.quant, sell = 0, name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

fodasi.png

Editado Outubro 21 por GniusP

JS LotusJ
21 de outubro de 2018 às 22:09
22 horas atrás, GniusP disse:

 

Colega passei algumas horas da madrugada fazendo esse script, creio que ficou do jeito que você pediu.

Trade Window(janela de trade) ✔️

Player precisa ter x quantidade de storage para trocar por x item✔️

Storage é removida conforme a quantidade necessária(você pode configurar as quantidade de storage para cada item)✔️

Abaixo o script e um print de como ficou

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local shopWindow = {}
local t = {
 [2160] = {quant = 15}, -- item e a quantidade de storage que o player precisa
 [11447] = {quant = 13},-- item e a quantidade de storage que o player precisa
 [12345] = {quant = 1}-- item e a quantidade de storage que o player precisa
 }
 local storage = 120760733465 -- storage que o player precisa para trocar o item
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
 if getPlayerStorageValue(cid, storage) >= t[item].quant then
selfSay("Voce trocou "..t[item].quant.." storage por um {"..getItemNameById(item).."}", cid)
doPlayerAddItem(cid,item,1) -- item e a quantidade que o player vai ganhar
setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) - t[item].quant)
else
selfSay("Voce nao tem "..t[item].quant.. " storage para trocar por {"..getItemNameById(item).."}", cid)
  end
return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, buy = ret.quant, sell = 0, name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

fodasi.png

Funcionou perfeitamente, muito obrigado!

 

Fico feliz em saber que ainda existem pessoas como você dispostas a ajudar a comunidade.

GniusPG
21 de outubro de 2018 às 22:25
16 minutos atrás, JS Lotus disse:

Funcionou perfeitamente, muito obrigado!

 

Fico feliz em saber que ainda existem pessoas como você dispostas a ajudar a comunidade.

De nada, poderia da um REP+ e colocar como melhor resposta? uma mão lava a outra.

Bom proveito

JS LotusJ
21 de outubro de 2018 às 22:35
8 minutos atrás, GniusP disse:

De nada, poderia da um REP+ e colocar como melhor resposta? uma mão lava a outra.

Bom proveito

Cheguei ao limite máximo de reps por hoje, quando ser 00:00 reputo novamente, ok? Muito obrigado!

GniusPG
21 de outubro de 2018 às 22:41

Tranquilo, Obrigado.

BennyB
21 de outubro de 2018 às 23:43
A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico.