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

Lua Help script

dervin13

Active Member
Joined
Apr 26, 2008
Messages
459
Solutions
1
Reaction score
28
PHP:
  local nonDieDelay = 60*3 --- 3 minutos
function onPrepareDeath(cid,aa) -- Script by mock the bear
        if getWorldUpTime() <= nonDieDelay then
                doCreatureAddHealth(cid,getCreatureMaxHealth(cid))
                doCreatureAddMana(cid,getCreatureMaxMana(cid))
                doTeleportThing(cid,getTownTemplePosition(getPlaye  rTown(cid)))
                doRemoveCreature(cid)
                return false
        end
        return true
end

can i change it and use if the player log in??
 
There is no good idea, how it this supposed to work on login? prevent anyone from logging in during the first 3 minutes of uptime? :)(
 
Not 3 minutes i will change but i want that peoples dont die in the first 3 seconds at log in preventing mage bomb...
 
Code:
local storage = 19028
local nonDieDelay = 3

function onLogin(cid)
        doCreatureSetStorage(cid,storage,os.time()+nonDieDelay)
return true
end

function onPrepareDeath(cid,aa)
        if os.time() <= getCreatureStorage(cid, storage) then 
                doCreatureAddHealth(cid,getCreatureMaxHealth(cid)) 
                doCreatureAddMana(cid,getCreatureMaxMana(cid)) 
                doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid))) 
                doRemoveCreature(cid) 
                return false
        end 
        return true 
end
rep-me (:
 

Similar threads

Back
Top