Postado Novembro 17, 2012 12 anos 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
Postado Novembro 17, 2012 12 anos 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 Novembro 17, 2012 12 anos por xFatality (veja o histórico de edições)
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.