Ir para conteúdo

Featured Replies

Postado

Estou precisando editar o script desse tópico a seguir para dar o coração pro player somente se o target for level maior que 80, alguém pode me ajudar?

 

 

O script da um coração como recompensa para um player que matar outro.

O que eu preciso é que o player só receba o coração se ele tiver matado um player level maior que 80

  Citar

function onKill(cid, target)


    if isPlayer(cid) and isPlayer(target) then
    if getPlayerIp(cid) == getPlayerIp(target) then
 local config = {

Kname = getPlayerName(cid),
Tname = getPlayerName(target),
Tlevel = getPlayerLevel(target),
}

local heart = doPlayerAddItem(cid, 5943, 1)

doItemSetAttribute(heart, "name", "" ..config.Tname.. " Heart's")
doItemSetAttribute(heart, "description", "Killed at Level "..config.Tlevel.." by "..config.Kname..". " .. (getCreatureSkullType(cid) <= SKULL_GREEN and "(Unjustified)" or "(Justified)"))
    elseif getPlayerLevel(target) >80 then
    elseif getPlayerIp(cid) == getPlayerIp(target) then
doPlayerAddExp(cid, -10000)
    end
end
return true
end

 

 

Desde já grato!!!

 

@Rusherzin

 

Postado
function onKill(cid, target)

	if isPlayer(cid) and isPlayer(target) then
		if getPlayerIp(cid) ~= getPlayerIp(target) then
			if getPlayerLevel(target) >= 80 then
				local heart = doPlayerAddItem(cid, 5943, 1)
				if heart then
					doItemSetAttribute(heart, "name", "" .. getPlayerName(target) .. " Heart's")
					doItemSetAttribute(heart, "description", "Killed at Level ".. getPlayerLevel(target) .." by ".. getPlayerName(cid) ..". " .. (getCreatureSkullType(cid) <= SKULL_GREEN and "(Unjustified)" or "(Justified)"))
				end
			end
		elseif getPlayerIp(cid) == getPlayerIp(target) then
			doPlayerAddExp(cid, -10000)
		end
	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