when people die on my server they don't really die there health bar just disappears and i get a whole bunch of errors.
please help
here is the playerdeath.lua file
PHP:
[07/01/2012 22:21:59] [Error - CreatureScript Interface]
[07/01/2012 22:21:59] data/creaturescripts/scripts/playerdeath.lua:onPrepareDeath
[07/01/2012 22:21:59] Description:
[07/01/2012 22:21:59] data/creaturescripts/scripts/playerdeath.lua:12: bad argument #1 to 'abs' (number expected, got nil)
[07/01/2012 22:21:59] stack traceback:
[07/01/2012 22:21:59] [C]: in function 'abs'
[07/01/2012 22:21:59] data/creaturescripts/scripts/playerdeath.lua:12: in function <data/creaturescripts/scripts/playerdeath.lua:11>
please help
here is the playerdeath.lua file
PHP:
local config = {
deadProtection = getConfigInfo('deadProtection')
}
function relogPlayer(cid)
if isPlayer(cid) then
doRemoveCreature(cid)
end
end
function onPrepareDeath(cid, deathList)
if (isPlayer(cid) and ((math.abs config.deadProtection) >= getPlayerLevel(cid))) then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
setPlayerStorageValue(cid, 6612, 1)
addEvent(relogPlayer, 1000, cid)
else
return true
end
end
Last edited: