Ir para conteúdo
  • Cadastre-se

Posts Recomendados

To usando esse sistema pra dropar o coração do player quando é morto no pvp. Mas quando os jogadores estão duelando em PVP Zone, colocado pelo RME, o coração não dropa. Acho que isso acontece pq o jogador não chega a morrer, ele é teleportado pro temple quando fica sem vida, ai o coração não vem. Alguém sabe como arrumar?

hearts.lua

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)

local cidpos = getPlayerPosition(lastHitKiller)

loot = 5943

item = doPlayerAddItem(lastHitKiller,loot,1)

if(isPlayer(lastHitKiller) == TRUE) then

hitKillerName = getPlayerName(lastHitKiller)

doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..hitKillerName..".")

doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_ORANGE, "You Killed " .. getCreatureName(cid) .. ".")

doSendMagicEffect(cidpos,12)

else

hitKillerName = getCreatureName(lastHitKiller)

doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by a "..hitKillerName..".")

end

setItemName(item, ""..getPlayerName(cid).."\'s Heart")

return TRUE

end

creaturescripts.xml

<event type="death" name="Reward" event="script" value="hearts.lua"/>

Ja tentei mudar pra onpreparedeath, mas tb não funciona

Link para o post
Compartilhar em outros sites

Tenta :



function onDeath(cid, corpse, deathList)

if isPlayer(cid) and isPlayer(deathList[1]) then

doSetItemSpecialDescription(doPlayerAddItem(deathList[1],5943, 1),"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..getPlayerName(deathList[1])..".")

doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_CONSOLE_ORANGE, "You Killed " .. getCreatureName(cid) .. ".")

doSendMagicEffect(getPlayerPosition(deathList[1]), 12)

end

return true

end

Adicione a tag no creaturescript e registre o script no onLogin.lua

<event type="death" name="Reward" event="script" value="hearts.lua"/>

Agora vai em data > creaturescript > script > login.lua e adicione antes do último return true :

registerCreatureEvent(cid, "Reward")

Espero ter ajudado.

Obrigado,

Abraços.

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

separa10.png

husl5cs.png



click.gif

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.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo