Postado Fevereiro 20, 2019 6 anos @poko360 Ta registrado no login.lua também? Vê ai: Spoiler function onKill(cid, target) local exp1 = 1 local exp11 = 2 local exp2 = 3 local exp22 = 6 local exp3 = 9 local exp33 = 18 local exp4 = 27 local exp44 = 54 local exp5 = 81 local exp55 = 162 local exp6 = 243 local target = getCreatureTarget(cid) local lvl = getPlayerLevel(target) if isPlayer(cid) and isPlayer(target) then if getPlayerIp(cid) == getPlayerIp(target) then doCreatureSay(cid, "Voce nao recebe EXP por matar MC", TALKTYPE_ORANGE_1) return true end if getPlayerLevel(target) >= 1 and getPlayerLevel(target) <= 4999 and getPlayerLevel(cid) >= 1 then doSendAnimatedText(getPlayerPosition(cid), "10000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp1 * lvl) elseif getPlayerLevel(target) >= 5000 and getPlayerLevel(target) <= 9999 and getPlayerLevel(cid) >= 1 then doSendAnimatedText(getPlayerPosition(cid), "20000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp11 * lvl) elseif getPlayerLevel(target) >= 10000 and getPlayerLevel(target) <= 14999 and getPlayerLevel(cid) >= 1 then doSendAnimatedText(getPlayerPosition(cid), "30000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp2 * lvl) elseif getPlayerLevel(target) >= 15000 and getPlayerLevel(target) <= 19999 and getPlayerLevel(cid) >= 1 then doSendAnimatedText(getPlayerPosition(cid), "40000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp22 * lvl) elseif getPlayerLevel(target) >= 20000 and getPlayerLevel(target) <= 24999 and getPlayerLevel(cid) >= 1 then doSendAnimatedText(getPlayerPosition(cid), "50000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp3 * lvl) elseif getPlayerLevel(target) >= 25000 and getPlayerLevel(target) <= 29999 and getPlayerLevel(cid) >= 1 then doSendAnimatedText(getPlayerPosition(cid), "60000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp33 * lvl) elseif getPlayerLevel(target) >= 30000 and getPlayerLevel(target) <= 34999 and getPlayerLevel(cid) >= 1 then doSendAnimatedText(getPlayerPosition(cid), "70000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp4 * lvl) elseif getPlayerLevel(target) >= 35000 and getPlayerLevel(target) <= 39999 and getPlayerLevel(cid) >= 1 then doSendAnimatedText(getPlayerPosition(cid), "80000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp44 * lvl) elseif getPlayerLevel(target) >= 40000 and getPlayerLevel(target) <= 44999 and getPlayerLevel(cid) >= 1 then doSendAnimatedText(getPlayerPosition(cid), "90000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp5 * lvl) elseif getPlayerLevel(target) >= 45000 and getPlayerLevel(target) <= 49999 and getPlayerLevel(cid) >= 1 then doSendAnimatedText(getPlayerPosition(cid), "100000000", 210) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp55 * lvl) elseif getPlayerLevel(target) >= 50000 and getPlayerLevel(target) <= 90000 and getPlayerLevel(cid) >= 1 then doSendAnimatedText(getPlayerPosition(cid), "110000000", 210) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp6 * lvl) end elseif isMonster(target) then return false end return true end Se ainda tiver erro no script de cima, testa esse: Nova tag: <event type="death" name="pvpenf" event="script" value="pvpenf.lua"/> No login.lua: registerCreatureEvent(cid, "pvpenf") Spoiler function onDeath(cid, corpse, killer) local exp1 = 1 local exp11 = 2 local exp2 = 3 local exp22 = 6 local exp3 = 9 local exp33 = 18 local exp4 = 27 local exp44 = 54 local exp5 = 81 local exp55 = 162 local exp6 = 243 local lvl = getPlayerLevel(killer) if isPlayer(killer) and isPlayer(cid) then if getPlayerIp(killer) == getPlayerIp(cid) then doCreatureSay(killer, "Voce nao recebe EXP por matar MC", TALKTYPE_ORANGE_1) return true end if getPlayerLevel(cid) >= 1 and getPlayerLevel(cid) <= 4999 and getPlayerLevel(killer) >= 1 then doSendAnimatedText(getPlayerPosition(killer), "10000000", 215) doPlayerAddExperience(killer, getPlayerLevel(killer) * exp1 * lvl) elseif getPlayerLevel(cid) >= 5000 and getPlayerLevel(cid) <= 9999 and getPlayerLevel(killer) >= 1 then doSendAnimatedText(getPlayerPosition(killer), "20000000", 215) doPlayerAddExperience(killer, getPlayerLevel(killer) * exp11 * lvl) elseif getPlayerLevel(cid) >= 10000 and getPlayerLevel(cid) <= 14999 and getPlayerLevel(killer) >= 1 then doSendAnimatedText(getPlayerPosition(killer), "30000000", 215) doPlayerAddExperience(killer, getPlayerLevel(killer) * exp2 * lvl) elseif getPlayerLevel(cid) >= 15000 and getPlayerLevel(cid) <= 19999 and getPlayerLevel(killer) >= 1 then doSendAnimatedText(getPlayerPosition(killer), "40000000", 215) doPlayerAddExperience(killer, getPlayerLevel(killer) * exp22 * lvl) elseif getPlayerLevel(cid) >= 20000 and getPlayerLevel(cid) <= 24999 and getPlayerLevel(killer) >= 1 then doSendAnimatedText(getPlayerPosition(killer), "50000000", 215) doPlayerAddExperience(killer, getPlayerLevel(killer) * exp3 * lvl) elseif getPlayerLevel(cid) >= 25000 and getPlayerLevel(cid) <= 29999 and getPlayerLevel(killer) >= 1 then doSendAnimatedText(getPlayerPosition(killer), "60000000", 215) doPlayerAddExperience(killer, getPlayerLevel(killer) * exp33 * lvl) elseif getPlayerLevel(cid) >= 30000 and getPlayerLevel(cid) <= 34999 and getPlayerLevel(killer) >= 1 then doSendAnimatedText(getPlayerPosition(killer), "70000000", 215) doPlayerAddExperience(killer, getPlayerLevel(killer) * exp4 * lvl) elseif getPlayerLevel(cid) >= 35000 and getPlayerLevel(cid) <= 39999 and getPlayerLevel(killer) >= 1 then doSendAnimatedText(getPlayerPosition(killer), "80000000", 215) doPlayerAddExperience(killer, getPlayerLevel(killer) * exp44 * lvl) elseif getPlayerLevel(cid) >= 40000 and getPlayerLevel(cid) <= 44999 and getPlayerLevel(killer) >= 1 then doSendAnimatedText(getPlayerPosition(killer), "90000000", 215) doPlayerAddExperience(killer, getPlayerLevel(killer) * exp5 * lvl) elseif getPlayerLevel(cid) >= 45000 and getPlayerLevel(cid) <= 49999 and getPlayerLevel(killer) >= 1 then doSendAnimatedText(getPlayerPosition(killer), "100000000", 210) doPlayerAddExperience(killer, getPlayerLevel(killer) * exp55 * lvl) elseif getPlayerLevel(cid) >= 50000 and getPlayerLevel(cid) <= 90000 and getPlayerLevel(killer) >= 1 then doSendAnimatedText(getPlayerPosition(killer), "110000000", 210) doPlayerAddExperience(killer, getPlayerLevel(killer) * exp6 * lvl) end elseif isMonster(cid) then return false end return true end Editado Fevereiro 20, 2019 6 anos por gabriel28 (veja o histórico de edições)
Postado Fevereiro 20, 2019 6 anos Autor consegui fazer de um jeito aqui, peguei de um codigo que voce botou ali , e montei um aqui que nao da erro na distro, de qualquer forma mt obrigado REP+
Postado Fevereiro 20, 2019 6 anos O erro é bem simples, tem uma linha que seria essa: local lvl = getPlayerLevel(target) deveria estar depois de checar se realmente o target é player, porque no caso se atacar um monstro vai retornar esses erros tudo, então deveria estar depois dessa linha: if isPlayer(cid) and isPlayer(target) then ficando: function onKill(cid, target, lastHit) local exp1 = 1 local exp11 = 2 local exp2 = 3 local exp22 = 6 local exp3 = 9 local exp33 = 18 local exp4 = 27 local exp44 = 54 local exp5 = 81 local exp55 = 162 local exp6 = 243 if isPlayer(cid) and isPlayer(target) then local lvl = getPlayerLevel(target) if getPlayerIp(cid) == getPlayerIp(target) then doCreatureSay(cid, "Voce nao recebe EXP por matar MC", TALKTYPE_ORANGE_1) return true end if getPlayerLevel(target) > 1 and getPlayerLevel(target) < 5000 and getPlayerLevel(cid) > 1 then doSendAnimatedText(getPlayerPosition(cid), "10000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp1 * lvl) elseif getPlayerLevel(target) > 5000 and getPlayerLevel(target) < 10000 and getPlayerLevel(cid) > 1 then doSendAnimatedText(getPlayerPosition(cid), "20000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp11 * lvl) elseif getPlayerLevel(target) > 10000 and getPlayerLevel(target) < 15000 and getPlayerLevel(cid) > 1 then doSendAnimatedText(getPlayerPosition(cid), "30000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp2 * lvl) elseif getPlayerLevel(target) > 15000 and getPlayerLevel(target) < 20000 and getPlayerLevel(cid) > 1 then doSendAnimatedText(getPlayerPosition(cid), "40000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp22 * lvl) elseif getPlayerLevel(target) > 20000 and getPlayerLevel(target) < 25000 and getPlayerLevel(cid) > 1 then doSendAnimatedText(getPlayerPosition(cid), "50000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp3 * lvl) elseif getPlayerLevel(target) > 25000 and getPlayerLevel(target) < 30000 and getPlayerLevel(cid) > 1 then doSendAnimatedText(getPlayerPosition(cid), "60000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp33 * lvl) elseif getPlayerLevel(target) > 30000 and getPlayerLevel(target) < 35000 and getPlayerLevel(cid) > 1 then doSendAnimatedText(getPlayerPosition(cid), "70000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp4 * lvl) elseif getPlayerLevel(target) > 35000 and getPlayerLevel(target) < 40000 and getPlayerLevel(cid) > 1 then doSendAnimatedText(getPlayerPosition(cid), "80000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp44 * lvl) elseif getPlayerLevel(target) > 40000 and getPlayerLevel(target) < 45000 and getPlayerLevel(cid) > 1 then doSendAnimatedText(getPlayerPosition(cid), "90000000", 215) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp5 * lvl) elseif getPlayerLevel(target) > 45000 and getPlayerLevel(target) < 50000 and getPlayerLevel(cid) > 1 then doSendAnimatedText(getPlayerPosition(cid), "100000000", 210) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp55 * lvl) elseif getPlayerLevel(target) > 50000 and getPlayerLevel(target) < 90000 and getPlayerLevel(cid) > 1 then doSendAnimatedText(getPlayerPosition(cid), "110000000", 210) doPlayerAddExperience(cid, getPlayerLevel(cid) * exp6 * lvl) end end return true end fica ai de aprendizagem. [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Abril 9, 2019 6 anos Autor bom dia, eu dei uma modificada no meu script e ele ta assim: Spoiler function onKill(cid, target, lastHit) local target = getCreatureTarget(cid) if isPlayer(cid) and isPlayer(target) then doSendAnimatedText(getPlayerPosition(cid), "20000000", 215) doPlayerAddExperience(cid, getPlayerExperience(target) / 5000) else return true end return true end só que tipo, ele funciona perfeitamente o unico problema é que quando eu mato o summon do player que eu to atacando com uma magia de area, eu ganho a experiencia dele nao tem nenhum tipo de linha que bloqueie o ganho de experiencia de summons nao? me ajdua pf
Postado Abril 9, 2019 6 anos @poko360 Não sei mt disso mais né é aqui não? doPlayerAddExperience(cid, getPlayerExperience(target) / 5000)
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.