Postado Fevereiro 15, 2015 10 anos function onUse(cid) local configs = { vipcoins = xxxx; -- Id do coins -- Primeiro item : 50% de chance, segundo 40%, terçeiro 30%, '' 15%, '' 5% items = {xxxx, xxxx, xxxx, xxxx, xxxx}; -- Id dos items } local rand = math.random(1, 140); if doPlayerRemoveItem(cid, configs.vipcoins, 1) then if rand <= 50 then -- 50% doPlayerAddItem(cid, configs.items[1], 1); doPlayerSendTextMessage(cid, 19, 'Congratulations !!'); doSendMagicEffect(getThingPos(cid), 14); elseif rand <= 90 then -- 40% doPlayerAddItem(cid, configs.items[2], 1); doPlayerSendTextMessage(cid, 19, 'Congratulations !!'); doSendMagicEffect(getThingPos(cid), 14); elseif rand <= 120 then -- 30% doPlayerAddItem(cid, configs.items[3], 1); doPlayerSendTextMessage(cid, 19, 'Congratulations !!'); doSendMagicEffect(getThingPos(cid), 14); elseif rand <= 135 then -- 15% doPlayerAddItem(cid, configs.items[4], 1); doPlayerSendTextMessage(cid, 19, 'Congratulations !!'); doSendMagicEffect(getThingPos(cid), 14); elseif rand <= 140 then -- 5% doPlayerAddItem(cid, configs.items[5], 1); doPlayerSendTextMessage(cid, 19, 'Congratulations !!'); doSendMagicEffect(getThingPos(cid), 14); end else doPlayerSendTextMessage(cid, 19, 'You no have vipcoins.'); end return true end Testei e funcionando 100%.
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.