DuvidasOt 0 Postado Outubro 2, 2013 Share Postado Outubro 2, 2013 Nesse script de item Random tem como fazer anunciar para o serve inteiro quando ganhar o item? items = { [0] = {id = 2493, count = 1, chance = 10}, <<< --- Quando ganhar esse item anunciar para o serve todo, com uma mensagem em branco [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) 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 Link para o comentário https://xtibia.com/forum/topic/222061-script-de-item-random/ Compartilhar em outros sites More sharing options...
0 Omega 377 Postado Outubro 2, 2013 Share Postado Outubro 2, 2013 (editado) 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 Editado Outubro 2, 2013 por omega blueheaven Link para o comentário https://xtibia.com/forum/topic/222061-script-de-item-random/#findComment-1568450 Compartilhar em outros sites More sharing options...
0 DuvidasOt 0 Postado Outubro 2, 2013 Autor Share Postado Outubro 2, 2013 Deu esse erro: http://www.netupload.org/visualizar.php?arquivo=ujnt7s9s4nhqqg0exo33.png Link para o comentário https://xtibia.com/forum/topic/222061-script-de-item-random/#findComment-1568452 Compartilhar em outros sites More sharing options...
0 Omega 377 Postado Outubro 2, 2013 Share Postado Outubro 2, 2013 Faltou fechar um parênteses: 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[i].chance > math.random(1, 100)) then doPlayerAddItem(cid, items[i].id, items[i].count) if i == 0 then doBroadcastMessage(getCreatureName(cid)..' ganhou o item '..getItemNameById(items[i].id)..'!', 22) end doRemoveItem(item.uid, 1) return doCreatureSay(cid, 'Wow Você Ganho! Seu Item e '..getItemNameById(items[i].id)..'!', TALKTYPE_MONSTER) end end doRemoveItem(item.uid, 1) return doCreatureSay(cid, 'Não ganhei nada!', TALKTYPE_MONSTER) end Link para o comentário https://xtibia.com/forum/topic/222061-script-de-item-random/#findComment-1568454 Compartilhar em outros sites More sharing options...
0 DuvidasOt 0 Postado Outubro 2, 2013 Autor Share Postado Outubro 2, 2013 Funcionou =D vlw Duvida Resolvida. Link para o comentário https://xtibia.com/forum/topic/222061-script-de-item-random/#findComment-1568462 Compartilhar em outros sites More sharing options...
0 Mophus 128 Postado Outubro 2, 2013 Share Postado Outubro 2, 2013 Tópico movido para a seção de dúvidas e pedidos resolvidos. Link para o comentário https://xtibia.com/forum/topic/222061-script-de-item-random/#findComment-1568515 Compartilhar em outros sites More sharing options...
Pergunta
DuvidasOt 0
Nesse script de item Random tem como fazer anunciar para o serve inteiro quando ganhar o item?
Link para o comentário
https://xtibia.com/forum/topic/222061-script-de-item-random/Compartilhar em outros sites
5 respostass a esta questão
Posts Recomendados