Postado Agosto 10, 2017 7 anos eae galera to com problema num script, é seguinte: é de coletar itens ao clicar no monstro.. ele coleta os itens porem ele só informa a quantidade de itens que agrupam.. moeda, worm, etc.. os demais itens como arma, escudo, helmet.. etc que não agrupam ele nao informa a quantidade.. alguem pode me ajudar? function onUse(cid, item, frompos, item2, topos) local items = {} for x = (getContainerSize(item.uid) - 1), 0, -1 do local k = getContainerItem(item.uid, x) table.insert(items, {i=k.itemid, q=k.type}) doRemoveItem(k.uid) end if #items == nil then return false end for y=1, #items do doPlayerAddItemStacking(cid, items[y].i, items[y].q) doPlayerSendTextMessage(cid, 20, "Looted "..items[y].q.."x "..getItemNameById(items[y].i)..".") end return true end Mostrar conteúdo oculto function doPlayerAddItemStacking(cid, itemid, quant) -- by mkalo local item = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid) local piles = 0 if #item > 0 then for i,x in pairs(item) do if getThing(x).type < 100 then local it = getThing(x) doTransformItem(it.uid, itemid, it.type+quant) if it.type+quant > 100 then doPlayerAddItem(cid, itemid, it.type+quant-100) end else piles = piles+1 end end else return doPlayerAddItem(cid, itemid, quant) end if piles == #item then doPlayerAddItem(cid, itemid, quant) end end @aspira Resolvido graças ao meu amigo
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.