Postado Maio 10, 2016 9 anos 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 Maio 10, 2016 9 anos por gmstrikker (veja o histórico de edições)
Postado Maio 10, 2016 9 anos 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 Maio 10, 2016 9 anos por Vodkart (veja o histórico de edições) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#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.