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

Restore Character Items-level-skills-everything when die

mocoba

New Member
Joined
Aug 23, 2008
Messages
332
Reaction score
0
Hello Otland SUpport

i want make when Character die restore all Items-level-skills-everything (Server War)
can anyone help me ?
 
Unsure of your server version.. but in my config.lua I have this
Code:
  -- Saving-related
   houseDataStorage = "binary"
   saveGlobalStorage = true
   storePlayerDirection = false
   savePlayerData = true
If you set savePlayerData to false.. then when the player logs out/dies/disconnects, there would be no changes to the base character?
 
Unsure of your server version.. but in my config.lua I have this
Code:
  -- Saving-related
   houseDataStorage = "binary"
   saveGlobalStorage = true
   storePlayerDirection = false
   savePlayerData = true
If you set savePlayerData to false.. then when the player logs out/dies/disconnects, there would be no changes to the base character?
I believe the player or it's userdata is temporarily stored in memory and then sent to the database for storage when the players logs out, dies or there is a server save.
I am just assuming this is the case because when the server crashes those gained items, lvls etc are lost because they were never sent to the database to be saved.
 
I believe the player or it's userdata is temporarily stored in memory and then sent to the database for storage when the players logs out, dies or there is a server save.
I am just assuming this is the case because when the server crashes those gained items, lvls etc are lost because they were never sent to the database to be saved.
Right, so if you set it to not save playerData.. if would effectively keep the player at a 'default' setting forever.. no matter what happens to the character while it's online? Once it logs off, or back in, it would always come back online with the default information set-up beforehand
 
Hello Otland SUpport

i want make when Character die restore all Items-level-skills-everything (Server War)
can anyone help me ?
Just don't let them die :)

In 'onPrepareDeath' event:
PHP:
local positionSpawn = {x=1000, y=1000, z=7}
function onPrepareDeath(creature, killer)
    -- heal him
    creature:addHealth(creature:getMaxHealth())

    -- maybe add him full mana?

    -- teleport to spawn
    creature:teleportTo(positionSpawn, true)

    -- return false = BLOCK DEATH! :)
    return false
end
Code not tested. Remember to add 'registerEvent' in player 'onLogin' script.
 
Back
Top