• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved playerdeath.lua

XouruS

Active Member
Joined
Dec 29, 2009
Messages
941
Reaction score
36
Location
Canada
Hello, im using TFS 0.3.6.
My my characters cant die with 0hp :/

60221725.jpg




The error in console:
[12/09/2010 10:31:17] [Error - CreatureScript Interface]
[12/09/2010 10:31:17] data/creaturescripts/scripts/playerdeath.lua:eek:nPrepareDeath
[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:
Back
Top