• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Chance to restoration from death

Nerevr back

Member
Joined
Nov 7, 2014
Messages
269
Reaction score
7
There anyway to make items if i have it give me chance to
restoration from death example "if somone killed me and i have this items give chance to back me again to game and this chance refile every 15 min ..." its Hard im use Tfs 0.4 8.60 ... i seen it be4 in oto. hope somone understand what i need
 
Use onPrepareDeath creaturescript, here's the base of the code. then just add a storage for the cooldown.

Code:
    if getPlayerItemCount(cid, itemid) >= 1 then
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
 
What do you mean by "back me again to game"? Should the character be teleported to the temple instead of dieing or just not dieing and stay on it's position? What should happen with the item, should it be removed? How big should the chance be?
 
not tp to temple .. stay on it's position with full hp...no items don't remove "example" when player die and he have this items he will back again to game and to this items work again need 15 min to refli so if the same player die again after first die be4 15 min e will die normaly " sorry english bad
 
Code:
local storage = 36539
function onPrepareDeath(cid, deathList)
     if getPlayerItemCount(cid, 2112) >= 1 and not exhaustion.check(cid, storage) then
         if math.random(1, 4) == 1 then
             exhaustion.set(cid, storage, 900)
             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You've been revived by the ... item, it will have a 15 min cooldown.")
             doCreatureAddMana(cid, getCreatureMaxMana(cid), false)
             doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)    
             return false
         end
     end
     return true
end
 
Last edited:
Code:
local storage = 36539
function onPrepareDeath(cid, deathList)
     if getPlayerItemCount(cid, 2112) >= 1 and exhaustion.check(cid, storage) then
         if math.random(1, 4) == 1 then
             exhaustion.set(cid, storage, 900)
             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You've been revived by the ... item, it will have a 15 min cooldown.")
             doCreatureAddMana(cid, getCreatureMaxMana(cid), false)
             doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)    
             return false
         end
     end
     return true
end
don't work :S don't gave me any error but not work
 
Back
Top