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="Hearts" event="script" value="hearts.lua"/>
login.lua
registerCreatureEvent(cid,'Hearts')
O Problema eh q dá esse erro na distro q estarei postando abaixo não da o coração e o player q morre some em vez de deixar corpo some como c fosse area pvp e o script não funciona !
Aqui o erro na distro !
[18:36:45.867] [Error - CreatureScript Interface]
[18:36:45.867] data/creaturescripts/scripts/hearts.lua:onDeath
[18:36:45.868] Description:
[18:36:45.869] (luaGetThingPosition) Thing not found
[18:36:45.870] [Error - CreatureScript Interface]
[18:36:45.870] data/creaturescripts/scripts/hearts.lua:onDeath
[18:36:45.871] Description:
[18:36:45.871] (luaDoPlayerAddItem) Player not found
[18:36:45.872] [Error - CreatureScript Interface]
[18:36:45.872] data/creaturescripts/scripts/hearts.lua:onDeath
[18:36:45.873] Description:
[18:36:45.873] (luaGetCreatureName) Creature not found
[18:36:45.874] [Error - CreatureScript Interface]
[18:36:45.875] data/creaturescripts/scripts/hearts.lua:onDeath
[18:36:45.875] Description:
[18:36:45.876] data/creaturescripts/scripts/hearts.lua:12: attempt to concatena
e global 'hitKillerName' (a boolean value)
[18:36:45.876] stack traceback:
[18:36:45.877] data/creaturescripts/scripts/hearts.lua:12: in function <data/c
eaturescripts/scripts/hearts.lua:1>
[18:36:45.941] BlackOut Own's has logged out.
Alguém resolve isso pra mim ? \: