Ir para conteúdo

Featured Replies

Postado
  • Autor

Vá em Data>CreatureEvents>Scripts crie uma pasta.lua chamada hearts.lua e coloque isso:


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

Agora vá em Data>CreatureScripts.xml e Adicione esta Tag la:


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

Assim Tu mata um Player e tu Vai Ganhar um Item Morgaroth Heart, So que com o outro name assim!!
Mano já tinha testado esse não funfa tambem \: o problema eh q da os erros na distro e o player morre e some tá ligado ? como c fosse area pvp !
Bom amigo, voce vem pedindo esse script na minha fábrica, tive um tempinho para fazer ele : Teste esse aqui. ->


-- Script by: OrochiElf --


function onKill(cid, target, lastHit)

local heart = 2160

local add = doPlayerAddItem(lastHit, heart)


if isPlayer(target) then

doSetItemAttribute(add, "description","The heart is of "..getCreatureName(target).."")

end

return true

end

Ondeath not found '-'

Ps: Creio q o erro não e na distro pqê testei em outras 2 '-' Mesmo erro ..

          Procuro Equipe para projeto sério com remuneração, maior necessidade Programador em C\C++.

  • Respostas 19
  • Visualizações 1.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • info_table = { ITEMID = 12661, -- ## ID do item do coração ## -- QUANTIDADE = 1, -- ## quantidade de coração ## -- LEVEL_ = 350 -- ## Level que dropa o coração ## -- } function onKill(cid, target,

Postado

Subistitua o Primeiro Por


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

Postado
  • Autor

Subistitua o Primeiro Por


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

[17:28:10.950] [Error - CreatureScript Interface]

[17:28:10.993] data/creaturescripts/scripts/coracao.lua:onDeath

[17:28:10.993] Description:

[17:28:10.994] data/creaturescripts/scripts/coracao.lua:3: attempt to call globa

l 'doSetItemSpecialDescription' (a nil value)

[17:28:11.075] stack traceback:

[17:28:11.076] data/creaturescripts/scripts/coracao.lua:3: in function <data/cr

eaturescripts/scripts/coracao.lua:1>

Deu isso ae mais foi uma evolução já q esse pelo menos deu um Morga Hearth kk mano to quase acreditando q seja na distro mesmo por esse valor nulo ai e nem um script funcionar O=

          Procuro Equipe para projeto sério com remuneração, maior necessidade Programador em C\C++.

Postado

[17:28:10.950] [Error - CreatureScript Interface]

[17:28:10.993] data/creaturescripts/scripts/coracao.lua:onDeath

[17:28:10.993] Description:

[17:28:10.994] data/creaturescripts/scripts/coracao.lua:3: attempt to call globa

l 'doSetItemSpecialDescription' (a nil value)

[17:28:11.075] stack traceback:

[17:28:11.076] data/creaturescripts/scripts/coracao.lua:3: in function <data/cr

eaturescripts/scripts/coracao.lua:1>

Deu isso ae mais foi uma evolução já q esse pelo menos deu um Morga Hearth kk mano to quase acreditando q seja na distro mesmo por esse valor nulo ai e nem um script funcionar O=

Se alguem resolver ai leva meu rep tbm, tbm quero e se descobrir o que é me passa leva meu rep :D

Editado por tiagoduuarte (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.

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.7k

Informação Importante

Confirmação de Termo