Bom dia, estou com uma duvida em um script, ja tentei colocar quantidade do item, mas nao estou conseguindo fazer funcionar. Alguém pode me ajudar? ?
Citarfunction onUse(cid, item, fromPos, item2, count, toPos)
local _ = {
[1] = {aid = 1234, item = 2160,25}, -- Aqui gostaria de colocar a quantidade 25 e colocar mais de um item em um unico bau.
[2] = {aid = 1235, item = 2195},
[3] = {aid = 1231, item = 3121},
}for i = 1, #_ do
_.storage = 202049 + i
endfor i, valor in ipairs(_) do
if item.actionid == valor.aid then
if getPlayerFreeCap(cid) >= getItemWeightById(valor.item, 1) then
if getPlayerStorageValue(cid, valor.storage) == -1 then
if doPlayerAddItem(cid, valor.item, 1, false) then
doPlayerSendTextMessage(cid, 22, 'You have found a '..getItemNameById(valor.item)..'.')
setPlayerStorageValue(cid, valor.storage, 1)
else
doPlayerSendTextMessage(cid, 22, 'You have found a '..getItemNameById(valor.item)..', but you need a free slot.')
end
else
doPlayerSendTextMessage(cid, 22, 'It is empty.')
end
else
doPlayerSendTextMessage(cid, 22, 'You have found a '..getItemNameById(valor.item)..'. It weighs '..getItemWeightById(valor.item, 1)..'.00 and it is too heavy.')
end
break
end
end
return true
end
Gostaria de colocar mais de um item no bau e quantidade, mas manter esse esquema de script pois iria facilitar muito organizar as quests do meu servidor.
Obrigado.