Postado Julho 30, 2014 10 anos creio q o erro esta ocorrendo pq vc esta tentando verificar o level do target, sem verificar se o target é um player, ou seja se tem mesmo um level, eu faria assim: local LEVEL_VARIATION = 100 local LOSER_EXP_PER_LEVEL = 5000 function onKill(cid, target, lastHit) if not isPlayer(target) or getCreatureSkullType(target) >= 1 then return true end local TARGET_LEVEL_VARIATION = (getPlayerLevel(cid) - getPlayerLevel(target)) if TARGET_LEVEL_VARIATION >= LEVEL_VARIATION then local EXP_PUNISHMENT = TARGET_LEVEL_VARIATION * LOSER_EXP_PER_LEVEL doPlayerSendTextMessage(cid,22,'Voce foi punido por falta de honra! Matou um player com '..TARGET_LEVEL_VARIATION..' leveis de diferenca e perdeu '..EXP_PUNISHMENT..' pontos de exp.') doPlayerAddExp(cid, -EXP_PUNISHMENT) doCreatureSay(cid, "Power Abuse punido!", TALKTYPE_ORANGE_1) end return true end
Postado Julho 30, 2014 10 anos Autor VLWWWWWWWWWWWWWW mano se fazer isso agr te dou 8 reps Queria que esse script só funciona-se se o cara que morreu fosse lvl 150- Pq um lvl 400 mata um lvl 300 e perde exp feião, kkkkkk Editado Julho 30, 2014 10 anos por gmstrikker (veja o histórico de edições)
Postado Julho 30, 2014 10 anos Solução local LEVEL_VARIATION = 100 local LOSER_EXP_PER_LEVEL = 5000 function onKill(cid, target, lastHit) if not isPlayer(target) or getCreatureSkullType(target) >= 1 then return true end if getPlayerLevel(target) > 150 then return true end local TARGET_LEVEL_VARIATION = (getPlayerLevel(cid) - getPlayerLevel(target)) if TARGET_LEVEL_VARIATION >= LEVEL_VARIATION then local EXP_PUNISHMENT = TARGET_LEVEL_VARIATION * LOSER_EXP_PER_LEVEL doPlayerSendTextMessage(cid,22,'Voce foi punido por falta de honra! Matou um player com '..TARGET_LEVEL_VARIATION..' leveis de diferenca e perdeu '..EXP_PUNISHMENT..' pontos de exp.') doPlayerAddExp(cid, -EXP_PUNISHMENT) doCreatureSay(cid, "Power Abuse punido!", TALKTYPE_ORANGE_1) end return true end
Postado Julho 30, 2014 10 anos Autor Coloquei como melor resposta e vou te dar os 8 reps como prometido, mas não querendo abusar, mas já abusando... N to conseguindo fazer queria fazer assim se o morto tive-se pk a variavel local LOSER_EXP_PER_LEVEL = 1000 E se o morto não fosse pk a variavel local LOSER_EXP_PER_LEVEL = 5000 Eu tentei assim, mas parece q n fiz da melhor forma e não funcionou Citar local LEVEL_VARIATION = 100 local LOSER_EXP_PER_LEVEL = 5000 function onKill(cid, target, lastHit) if not isPlayer(target) then return true end if getPlayerLevel(target) > 100 then return true end local TARGET_LEVEL_VARIATION = (getPlayerLevel(cid) - getPlayerLevel(target)) if TARGET_LEVEL_VARIATION >= LEVEL_VARIATION then local EXP_PUNISHMENT = TARGET_LEVEL_VARIATION * LOSER_EXP_PER_LEVEL if getCreatureSkullType(target) >= 1 then doPlayerSendTextMessage(cid,22,'Voce foi punido por falta de honra! Matou um player com '..TARGET_LEVEL_VARIATION..' leveis de diferenca e perdeu '..EXP_PUNISHMENT..' pontos de exp.') doPlayerAddExp(cid, -EXP_PUNISHMENT/2) doCreatureSay(cid, "Power Abuse punido!", TALKTYPE_ORANGE_1) return true end doPlayerSendTextMessage(cid,22,'Voce foi punido por falta de honra! Matou um player com '..TARGET_LEVEL_VARIATION..' leveis de diferenca e perdeu '..EXP_PUNISHMENT..' pontos de exp.') doPlayerAddExp(cid, -EXP_PUNISHMENT) doCreatureSay(cid, "Power Abuse punido!", TALKTYPE_ORANGE_1) end return true end
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.