Ir para conteúdo

Featured Replies

Postado

boa noite, preciso de uma força se possivel.

possuo um script de pvp-enforced, quando um player morre, TODOS que participaram da kill, recebem xp.
queria colocar so pra quem deu o ultimo hit ganhar a xp

e um script anti-MC nele

 

alguem pode desenrolar pf?

script:

Spoiler

function onKill(cid, target, lastHit)
local storage = getPlayerStorageValue(target, 2310)
    if getPlayerLevel(cid) <= 100000 and isPlayer(cid) and isPlayer(target) then
            doSendAnimatedText(getPlayerPosition(cid), "5000000", 215)
            doPlayerAddExperience(cid, (storage*1) * (getPlayerExperience(target) / 1000))
    else
        return true
    end
return true
end
 

 

Postado
18 horas atrás, poko360 disse:

boa noite, preciso de uma força se possivel.

possuo um script de pvp-enforced, quando um player morre, TODOS que participaram da kill, recebem xp.
queria colocar so pra quem deu o ultimo hit ganhar a xp

e um script anti-MC nele

 

alguem pode desenrolar pf?

script:

  Ocultar conteúdo

function onKill(cid, target, lastHit)
local storage = getPlayerStorageValue(target, 2310)
    if getPlayerLevel(cid) <= 100000 and isPlayer(cid) and isPlayer(target) then
            doSendAnimatedText(getPlayerPosition(cid), "5000000", 215)
            doPlayerAddExperience(cid, (storage*1) * (getPlayerExperience(target) / 1000))
    else
        return true
    end
return true
end
 

 

 

A função foi mudada para onDeath()

--[[Script criado por ~Mathias Kenfi
	Email: [email protected]
	Contato: 034991286815
]]--

function onDeath(cid, corpse, deathList)

local storage = getPlayerStorageValue(cid, 2310)
	if isPlayer(cid) and isPlayer(deathList[1]) then
		if getPlayerIp(cid) ~= getPlayerIp(deathList[1]) then
			if getPlayerLevel(deathList[1]) <= 100000 then
				doPlayerAddExperience(deathList[1], (storage*1) * (getPlayerExperience(cid) / 1000))
			end
		end
	end
	return true
end

 

Postado
22 horas atrás, poko360 disse:

testei aqui, e nao deu xp

mudei pra death:
       <event type="death" name="pvpenf" event="script" value="pvpenf.lua"/>

 

Mudança de evento é necessário reiniciar, você reiniciou?

 

Qual a versão do seu OT? Qual versão da sua source? 

22 horas atrás, poko360 disse:

testei aqui, e nao deu xp

mudei pra death:
       <event type="death" name="pvpenf" event="script" value="pvpenf.lua"/>

 

--[[Script criado por ~Mathias Kenfi
	Email: [email protected]
	Contato: 034991286815
]]--

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
storage = getPlayerStorageValue(cid, 23100)
target = lastHitKiller[1]
	if not(isPlayer(cid)) then
		return false
	end
	
	if not(isPlayer(target)) then
		return false
	end
		if getPlayerIp(cid) ~= getPlayerIp(target) then
			if getPlayerLevel(target) <= 100000 then
				doPlayerAddExperience(target, (storage*1) * (getPlayerExperience(cid) / 1000))
			end
		end
	return true
end

A função foi mudada para onPrepareDeath()

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo