Ir para conteúdo

Featured Replies

Postado

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
  • Respostas 8
  • Visualizações 506
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Se tu postasse o teu script daria pra ajudar né. '-' Basta criar vários scripts e modificar o level aqui: local diff = 100 E a xp aqui: local puni = (dif*5000)

  • Talvez seja a função onkill. Preciso dar uma saida quando eu voltar(talvez amanha) se não tiverem feito eu faço.

  • 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

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

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.6k

Informação Importante

Confirmação de Termo