Postado Maio 30, 2014 11 anos local config = { [90] = {ID, COUNT}, [80] = {ID, COUNT}, [59] = {ID, COUNT}, [50] = {ID, COUNT}, [40] = {ID, COUNT}, [30] = {ID, COUNT}, [20] = {ID, COUNT}, [10] = {ID, COUNT}, [3] = {ID, COUNT}, [1] = {ID, COUNT}, } function onUse(cid, item) local chance_growing = {} for chance, _ in pairs(config) do table.insert(chance_growing, chance) end table.sort(chance_growing, function(a, b) return a > b end) local chance = 0 for _, v in pairs(chance_growing) do if math.random(100) < v then chance = v break end end local item = config[chance] if item then doPlayerAddItem(cid, item[1], item[2]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Você encontrou ".. item[2] .." ".. item[1] .. ".") doSendMagicEffect(getThingPos(cid), 13) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Não foi dessa vez, tente na próxima ):") end doRemoveItem(item.uid, 1) return true end -"Supra Omnes Lux Lucis" - Acima de todos brilha a Luz -
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.