Ir para conteúdo
  • Cadastre-se

(Resolvido)Nivel alto não atacar nivel baixo


Ir para solução Resolvido por luanluciano93,

Posts Recomendados

vai no config.lua do servidor e procure por

 

protectionLevel =

 

e adicione 450 ou 500. ate o nivel 500 ngm pode matar ngm.

Editado por ITALOx (veja o histórico de edições)

 

 

 

 

 

                                                                                                                                                     tumblr_nwmv2z4VEM1ujiquxo1_100.gif.2db64bb36f0f565e68ff2a90cb98f439.gif.59f4c4cf234d2f6906621cac0553a862.gif

https://github.com/italoxxx1

 

Link para o post
Compartilhar em outros sites
2 minutos atrás, ITALOx disse:

vai no config.lua do servidor e procure por

 


protectionLevel =

 

e adicione 450 ou 500. ate o nivel 500 ngm pode matar ngm.

 

no caso oque eu quero é que tenha pvp nos leveis inferior a 450, mas que não tenha um power abuse de nivel alto matando nivel baixo.

Link para o post
Compartilhar em outros sites
  • Moderador
  • Solução
-- <event type="attack" name="onAttack" script="onAttack.lua"/>

local level = 450

function onAttack(cid, target)
	if not isPlayer(cid) or not isPlayer(target) then 
		return true
	end

	if getPlayerLevel(cid) >= level and getPlayerLevel(target) < level then
		return false
	elseif getPlayerLevel(target) >= level and getPlayerLevel(cid) < level then
		return false
	end

	return true
end

 

Link para o post
Compartilhar em outros sites
10 minutos atrás, luanluciano93 disse:

-- <event type="attack" name="onAttack" script="onAttack.lua"/>

local level = 450

function onAttack(cid, target)
	if not isPlayer(cid) or not isPlayer(target) then 
		return true
	end

	if getPlayerLevel(cid) >= level and getPlayerLevel(target) < level then
		return false
	elseif getPlayerLevel(target) >= level and getPlayerLevel(cid) < level then
		return false
	end

	return true
end

 

 

Esse script vai bloquear os niveis maior que 450 não atacar 450 menos? e também fazer os niveis baixo poder atacar uns aos outros normal só não atacando os niveis mais alto ?

Link para o post
Compartilhar em outros sites
Em 23/09/2019 em 22:28, luanluciano93 disse:

-- <event type="attack" name="onAttack" script="onAttack.lua"/>

local level = 450

function onAttack(cid, target)
	if not isPlayer(cid) or not isPlayer(target) then 
		return true
	end

	if getPlayerLevel(cid) >= level and getPlayerLevel(target) < level then
		return false
	elseif getPlayerLevel(target) >= level and getPlayerLevel(cid) < level then
		return false
	end

	return true
end

 

 

eu tentei fazer não abrir pk caso der o erro porém sem sucesso alguma idéia?

Compre seus Scripts Agora totalmente seguro e de forma rápida, aceitamos também encomendas.

discord.gg/phJZeHa2k4

 

Projeto ATS (Naruto)

Informações Abaixo

Facebook

Youtube
Discord

 

Tutoriais / Conteúdos

Clique Aqui

Link para o post
Compartilhar em outros sites

@luanluciano93 no caso nem chegar a abrir pk pra remover, caso targetar o alvo iria aparecer a mensagem de erro, ai no caso não chegando nem abrir o pk.

Compre seus Scripts Agora totalmente seguro e de forma rápida, aceitamos também encomendas.

discord.gg/phJZeHa2k4

 

Projeto ATS (Naruto)

Informações Abaixo

Facebook

Youtube
Discord

 

Tutoriais / Conteúdos

Clique Aqui

Link para o post
Compartilhar em outros sites
-- <event type="target" name="onTarget" script="onTarget.lua"/>

local level = 450

function onTarget(cid, target)
	if not isPlayer(cid) or not isPlayer(target) then 
		return true
	end

	if getPlayerLevel(cid) >= level and getPlayerLevel(target) < level then
		return false
	elseif getPlayerLevel(target) >= level and getPlayerLevel(cid) < level then
		return false
	end

	return true
end

NAO TESTADO

Link para o post
Compartilhar em outros sites
Em 01/10/2019 em 00:03, luanluciano93 disse:

-- <event type="target" name="onTarget" script="onTarget.lua"/>

local level = 450

function onTarget(cid, target)
	if not isPlayer(cid) or not isPlayer(target) then 
		return true
	end

	if getPlayerLevel(cid) >= level and getPlayerLevel(target) < level then
		return false
	elseif getPlayerLevel(target) >= level and getPlayerLevel(cid) < level then
		return false
	end

	return true
end

NAO TESTADO

 

funcionou perfeitamente testado em 0.3.6 Aprovado ✔️

Compre seus Scripts Agora totalmente seguro e de forma rápida, aceitamos também encomendas.

discord.gg/phJZeHa2k4

 

Projeto ATS (Naruto)

Informações Abaixo

Facebook

Youtube
Discord

 

Tutoriais / Conteúdos

Clique Aqui

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo