Ir para conteúdo

Featured Replies

Postado

Tava tentando fazer um sistema que entregaria skill de acordo com o maior skill

Ex: Se seu maior skill for o de sword, então você receberá skill de sword

 

O trexo do código é esse:

 

	                local axeskill = getPlayerSkillLevel(cid, SKILL_AXE)
	                local swordskill = getPlayerSkillLevel(cid, SKILL_CLUB)
	                local clubskill = getPlayerSkillLevel(cid, SKILL_SWORD)
	                if (axeskill > swordskill and axeskill > clubskill) then
	                    doPlayerAddSkillTry(cid, SKILL_AXE, axeqnt * axestages)
	                elseif (swordskill > axeskill and swordskill > clubskill) then
	                    doPlayerAddSkillTry(cid, SKILL_SWORD, swordqnt * swordstages)
	                elseif (clubskill > axeskill and clubskill > swordskill) then
	                    doPlayerAddSkillTry(cid, SKILL_CLUB, clubqnt * clubstages)
	                else -- negando tudo se bugar sei la
	                    doPlayerAddSkillTry(cid, SKILL_SWORD, swordqnt * swordstages)
	                end
	

1 minuto atrás, gmstrikker disse:

Tava tentando fazer um sistema que entregaria skill de acordo com o maior skill

Ex: Se seu maior skill for o de sword, então você receberá skill de sword

 

O trexo do código é esse:

 

 


	                local axeskill = getPlayerSkillLevel(cid, SKILL_AXE)
	                local swordskill = getPlayerSkillLevel(cid, SKILL_CLUB)
	                local clubskill = getPlayerSkillLevel(cid, SKILL_SWORD)
	                if (axeskill > swordskill and axeskill > clubskill) then
	                    doPlayerAddSkillTry(cid, SKILL_AXE, axeqnt * axestages)
	                elseif (swordskill > axeskill and swordskill > clubskill) then
	                    doPlayerAddSkillTry(cid, SKILL_SWORD, swordqnt * swordstages)
	                elseif (clubskill > axeskill and clubskill > swordskill) then
	                    doPlayerAddSkillTry(cid, SKILL_CLUB, clubqnt * clubstages)
	                else -- negando tudo se bugar sei la
	                    doPlayerAddSkillTry(cid, SKILL_SWORD, swordqnt * swordstages)
	                end
	

 

 

Editado por gmstrikker (veja o histórico de edições)

Postado

 

Citar

n = 0
for i = 1,3 do
if getPlayerSkillLevel(cid, i) >= n then
n, High_Skill = getPlayerSkillLevel(cid, i), i
end
end
doPlayerAddSkillTry(cid, High_Skill , STAGES)

 

 

Editado por Vodkart (veja o histórico de edições)

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

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 520k

Informação Importante

Confirmação de Termo