Ir para conteúdo

Featured Replies

Postado
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%.

EQD4Qy4.gif

  • Respostas 5
  • Visualizações 664
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • 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

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo