Hello, After alot of tests i cannot let working that.
preparedeath.lua
creaturescripts.xml
on login.lua i added
but it doesn't work for me, I'm using TFS 3.6pl thank you
preparedeath.lua
Code:
function onPrepareDeath(cid, deathList)
if isPlayer(cid) then
if getPlayerSlotItem(cid, 2).itemid == 11387 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerExperience(cid))
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), true)
doCreatureAddMana(cid, (getCreatureMaxMana(cid) - getCreatureMana(cid)))
doRemoveConditions(cid, FALSE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
doPlayerPopupFYI(cid, "You are dead.")
doRemoveCreature(cid)
end
end
return true
end
creaturescripts.xml
Code:
<event type="preparedeath" name="onPrepareDeath" event="script" value="preparedeath.lua"/>
on login.lua i added
Code:
registerCreatureEvent(cid, "onPrepareDeath")
but it doesn't work for me, I'm using TFS 3.6pl thank you