Ir para conteúdo

Posts Recomendados

Olá, Bom esse script que estou pedindo deve ser muito complexo porque até hoje só vi um ot com ele funcionando corretamente que é o Lendário pBot original...vou explicar como ele funciona, Acho que é um creaturescript. Quando um Player X mata um Player Y no corpo desse player Y (dentro do corpo) fica um coração e nesse coração tem uma mensagem que aparece quando da um look mais ou menos assim "Este é o coração de "Y" morto por "x" "

Conseguiram entender? Por Favor esse Script é muito legal e até agora eu não consegui fazer ele funcionar eu até tenho um, porém nunca funcionou

 

function onPrepareDeath(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

Editado por thonynunes
Link para o comentário
https://xtibia.com/forum/topic/182303-pedido-cora%C3%A7%C3%A3o-dentro-do-corpo-de-um-player-morto/
Compartilhar em outros sites

tenta assim:

function onDeath(cid, corpse, killer)

loot = 5943 -- id do coração
if isPlayer(killer) then
   item = doPlayerAddItem(corpse,loot,1)
   doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..getPlayerName(killer)..".")
   setItemName(item, ""..getPlayerName(cid).."\'s Heart")
   doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_ORANGE, "You Killed " .. getCreatureName(cid) .. ".")
end

return TRUE
end

 

Obs: Nem testei.

 

Muda a tag no creaturescripts.xml no lugar de "preparedeath" mude apenas para "death".

Oque eu coloco aqui oh...

 <event type="death" [color=#ff0000][b]name=""[/b][/color] script="heart.lua"/> 

 

Não funcionou :s

coloca:

<event type="death" name="Heart" script="heart.lua"/> 

 

E no script "login.lua" que esta em /scripts, antes do ultimo return true, coloca a tag:

registerCreatureEvent(cid, "Heart")

Esse que você me mandou não funciona, ve se consegue arrumar esse aqui oh...

function onDeath(cid, corpse, killer)
   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

×
×
  • Criar Novo...