isso mesmo amigo, o jogador não chega a morrer... Troque de função, mude de onDeath para onPrepareDeath,
abraços
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

isso mesmo amigo, o jogador não chega a morrer... Troque de função, mude de onDeath para onPrepareDeath,
abraços
Editado Novembro 17 por Vodkart
[Error-CreatureEvent::ConfigureEvent] No valid type for creature event: onPrepareDeath.
Da isso no console quando o player morre
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

u mad?
tem que refazer o script e mudar a tag cara
Eu mudei de OnDeath pra OnPrepareDeath ali na tag e
no script de
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
pra
function onPrepareDeath(cid, corpse, lastHitKiller, mostDamageKiller)
não seria isso? Tem como vc refazer pra mim?
tem que mudar a tag no creaturescripts.xml, de type="death" para type="preparedeath"
a function onPrepareDeath não tem esse tanto de parâmetros aí não, experimenta colocar só o cid, deve funcionar
Editado Novembro 17 por brun123
Fiz isso ai, parou de dar erro, só que agora não dropa o coração, mesma coisa de antes
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

acho que assim funciona
function onPrepareDeath(cid, deathList) local item = 5943 if isPlayer(cid) and isPlayer(deathList[1]) then local add = doPlayerAddItem(deathList[1],item,1) doSetItemSpecialDescription(add,"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
Não funcionou, e não aparece nenhum erro no console. O player não dropa o coração
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

já sei oque era, é que no seu script a função está errada.
function onPrepareDeath(cid, deathList) local item = 5943 if isPlayer(cid) and isPlayer(deathList[1]) then local add = doPlayerAddItem(deathList[1],item,1) doItemSetAttribute(add, "description","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
Ainda não funciona
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

? eu testei aqui mlk
<event type="preparedeath" name="HeartSys" event="script" value="nome do seu script.lua"/>
e no seu login.lua antes do último return true adc
registerCreatureEvent(cid, "HeartSys")
info
Grupo: Artesão
Registrado: 08/10/12
Posts: 114
Reputação: 0
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 endcreaturescripts.xml