spamfagu still fail
onLogin+storagevalue+doCreatureAddHealth+onprepare death
<event type="preparedeath" name="healthless" event="script" value="healthless.lua"/>
<event type="login" name="hless" event="script" value="healthless.lua"/>
local s = 13356 --player's storage
function onLogin(cid)
registerCreatureEvent(cid, 'healthless')
if getCreatureStorage(cid, s) == 1 then
doCreatureAddHealth(cid, -getCreatureMaxHealth(cid)+1)
doCreatureSetStorage(cid, s, 0)
end
return true
end
function onPrepareDeath(cid, deathList)
if isPlayer(cid) then
doCreatureSetStorage(cid, s, 1)
end
return true
end