Lua:
[21/04/2024 20:51:56] [Error - CreatureScript Interface]
[21/04/2024 20:51:56] data/creaturescripts/scripts/heart.lua:onDeath
[21/04/2024 20:51:57] Description:
[21/04/2024 20:51:57] data/lib/050-function.lua:222: attempt to index a boolean value
[21/04/2024 20:51:57] stack traceback:
[21/04/2024 20:51:58] data/lib/050-function.lua:222: in function 'getItemNameById'
[21/04/2024 20:51:58] data/creaturescripts/scripts/heart.lua:47: in function <data/creaturescripts/scripts/heart.lua:1>
XML:
function onDeath(cid, corpse, deathList)
function getHeartFromNivel(cid)
local t = {
[{10000,100000}] = 5943,
[{20000,200000}] = 5943,
[{30000,300000}] = 5943,
[{40000,400000}] = 5943,
[{50000,500000}] = 5943,
[{60000,600000}] = 5943,
[{70000,700000}] = 5943,
[{717217,math.huge}] = 5943
}
for var, ret in pairs(t) do
if getPlayerLevel(cid) >= var[1] and getPlayerLevel(cid) <= var[2] then
k = ret
end
end
return k
end
if isPlayer(cid) and getPlayerLevel(cid) >= 1000 and isPlayer(deathList[1]) then
local item = getHeartFromNivel(cid)
doItemSetAttribute(doPlayerAddItem(deathList[1],item, 1), "description", "This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..getPlayerName(deathList[1])..".")
if getPlayerLevel(cid) >= 5000 then
doBroadcastMessage("O Jogador ".. getCreatureName(deathList[1]) .. "[" .. getPlayerLevel(deathList[1]) .. "] Matou " .. getCreatureName(cid) .. "[" .. getPlayerLevel(cid) .. "] E retirou seu "..getItemNameById(item),18)
end
doSendMagicEffect(getPlayerPosition(deathList[1]), 12)
end
return true
end