Hello, im using TFS 0.3.6.
My my characters cant die with 0hp :/
The error in console:
And the script i use:
My my characters cant die with 0hp :/
The error in console:
[12/09/2010 10:31:17] [Error - CreatureScript Interface]
[12/09/2010 10:31:17] data/creaturescripts/scripts/playerdeath.luanPrepareDeath
[12/09/2010 10:31:17] Description:
[12/09/2010 10:31:17] data/creaturescripts/scripts/playerdeath.lua:12: bad argument #1 to 'abs' (number expected, got nil)
[12/09/2010 10:31:17] stack traceback:
[12/09/2010 10:31:17] [C]: in function 'abs'
[12/09/2010 10:31:17] data/creaturescripts/scripts/playerdeath.lua:12: in function <data/creaturescripts/scripts/playerdeath.lua:11>
And the script i use:
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: