function onUse(cid, item, frompos, item2, topos)
local items = {
[1] = {id = 2160, count = 100, chance = 10},
[2] = {id = 2160, count = 100, chance = 20},
[3] = {id = 2160, count = 100, chance = 30},
[4] = {id = 2160, count = 100, chance = 40},
[5] = {id = 2160, count = 100, chance = 50},
[6] = {id = 2160, count = 100, chance = 60},
[7] = {id = 2160, count = 100, chance = 70}
}
local itemDie = 5792
if item.itemid == itemDie then
for i = 1, #items do
if (items[1].chance > math.random(1, 100)) then
doPlayerAddItem(cid, items[i].id, items[i].count)
doPlayerSendTextMessage(cid, "Você Ganhou o item "..getItemNameById(items[i].id).."!", 22)
else
doPlayerSendTextMessage(cid, "Você não ganhou nada!", 22)
end
end
end
return TRUE
end
e a tag em actions.Xml :
<action fromid="5792" toid="5797" script="NomeDoArquivo.lua"/>







info
Grupo: Campones
Registrado: 02/01/14
Posts: 25
Reputação: +1
Galera eu to presiçando de um script, eu jogava um ot e tinha um evento, la vc ganhava 1 dado(
Die)
ao clicar nesse dado vc ganhava 1 item entre tantos
eu queria colocar 1kk,2 armors,2legs,2helmets
quando clicar no dado vai vim apenas 1 item
se alguem puder me ajudar agradeço desde ja