items = {
[0] = {id = 2493, count = 1, chance = 10},
[1] = {id = 2272, count = 1, chance = 60},
[2] = {id = 2173, count = 1, chance = 40},
[3] = {id = 2152, count = 5, chance = 80},
[4] = {id = 2152, count = 1, chance = 100},
}
function onUse(cid, item, fromPos, itemEx, toPos)
for i = 0, #items do
if (items.chance > math.random(1, 100)) then
doPlayerAddItem(cid, items.id, items.count)
if i == 0 then
doBroadcastMessage(getCreatureName(cid)..' ganhou o item '..getItemNameById(items.id..'!', 22)
end
doRemoveItem(item.uid, 1)
return doCreatureSay(cid, 'Wow Você Ganho! Seu Item e '..getItemNameById(items.id)..'!', TALKTYPE_MONSTER)
end
end
doRemoveItem(item.uid, 1)
return doCreatureSay(cid, 'Não ganhei nada!', TALKTYPE_MONSTER)
end






info
Grupo: Campones
Registrado: 30/09/13
Posts: 16
Reputação: 0
Nesse script de item Random tem como fazer anunciar para o serve inteiro quando ganhar o item?