Tem que colocar no lugar correto, no caso teria que ficar assim o Script:
local items = {
[0] = {id = 2160, count = 10, chance = 2},
[1] = {id = 2160, count = 20, chance = 5},
[2] = {id = 2160, count = 30, chance = 10},
[3] = {id = 2160, count = 40, chance = 15},
[4] = {id = 2160, count = 50, chance = 30},
[5] = {id = 2160, count = 70, chance = 90},
[5] = {id = 2160, count = 80, chance = 100}
}
function onUse(cid, item, fromPos, itemEx, toPos)
for i = 0, #items do
if (items[i].chance > math.random(1, 100)) then
doPlayerAddItem(cid, items[i].id, items[i].count)
doRemoveItem(item.uid)
return doCreatureSay(cid, 'Você Ganho o Item '..getItemNameById(items[i].id)..'!', TALKTYPE_MONSTER)
end
end
return doCreatureSay(cid, 'Não ganhei nada!', TALKTYPE_MONSTER)
end