• 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!

Hp back to One when i die!

Rikrdo

New Member
Joined
Mar 6, 2010
Messages
38
Reaction score
1
I Want to know how I do to change the hp that player back when he dies
example when I die and come again my hp will be at a one.

Thanks.
 
u still fail
spamfag :p

@OP, here it is, as I gave you the formula
onLogin+storagevalue+doCreatureAddHealth+onprepare death

TESTED @ TFS 0.3.6pl1 and WORKING

data/creaturescripts/creaturescripts.xml
LUA:
<event type="preparedeath" name="healthless" event="script" value="healthless.lua"/>
<event type="login" name="hless" event="script" value="healthless.lua"/>
data/creaturescripts/scripts/healthless.lua
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
 
Last edited:
Back
Top