• 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 [SOLVED] TFS 0.X No loose items or container bellow certain level

potinho

Intermediate OT User
Joined
Oct 11, 2009
Messages
1,397
Solutions
17
Reaction score
148
Location
Brazil
Hello guys, how are you?

I have this script to not loss experience bellow level 9 and remove AOL. I want to make a few change, not lose itens before level 60 (with ou without aol).
I already have this script who not remove experience bellow level 9.


Lua:
function onDeath(cid, corpse, deathList)
    if getPlayerSlotItem(cid, 2).itemid == 2173 then
                doPlayerRemoveItem(cid, 2173, 1)
end
    return true
end

function onDeath(cid, corpse, deathList)
    if getPlayerLevel(cid) < 9 then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
    end
    return true
end

Someone can help me to create this creaturescript to not loss items or bp when die, without aol bellow lvl 60?
 
Hello guys, how are you?

I have this script to not loss experience bellow level 9 and remove AOL. I want to make a few change, not lose itens before level 60 (with ou without aol).
I already have this script who not remove experience bellow level 9.


Lua:
function onDeath(cid, corpse, deathList)
    if getPlayerSlotItem(cid, 2).itemid == 2173 then
                doPlayerRemoveItem(cid, 2173, 1)
end
    return true
end

function onDeath(cid, corpse, deathList)
    if getPlayerLevel(cid) < 9 then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
    end
    return true
end

Someone can help me to create this creaturescript to not loss items or bp when die, without aol bellow lvl 60?
now if your level lower then 60 you will not loss items / experience

Lua:
function onDeath(cid, corpse, deathList)
if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2173)
doPlayerRemoveItem(cid, 2173, 1)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
if getPlayerLevel(cid) < 60 then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, loss * 0)
end
return true
end
end
end
 
now if your level lower then 60 you will not loss items / experience

Lua:
function onDeath(cid, corpse, deathList)
if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2173)
doPlayerRemoveItem(cid, 2173, 1)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
if getPlayerLevel(cid) < 60 then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, loss * 0)
end
return true
end
end
end
Items and experience loss are inverted? when player dies back to lvl 1
 
Solved, just creating new creaturescript:

XML:
    <event type="death" name="lossbp" event="script" value="lossbp.lua"/>

Script:

Lua:
function onDeath(cid, corpse, deathList)
            if isPlayer(cid) and getPlayerLevel(cid) < 60 then
           doSetCreatureDropLoot(cid, false)
       end
return true
end

And registred event on login.lua:
Lua:
    registerCreatureEvent(cid, "lossbp")
 
Where do you use this Lua?

''Lua:
function onDeath(cid, corpse, deathList)
if isPlayer(cid) and getPlayerLevel(cid) < 60 then
doSetCreatureDropLoot(cid, false)
end
return true
end''
 
Where do you use this Lua?

''Lua:
function onDeath(cid, corpse, deathList)
if isPlayer(cid) and getPlayerLevel(cid) < 60 then
doSetCreatureDropLoot(cid, false)
end
return true
end''
You have to create a creaturescript, like this on XML:

XML:
  <event type="death" name="lossbp" event="script" value="lossbp.lua"/>

And dont forget register this in login.lua.

Lua:
registerCreatureEvent(cid, "lossbp")
 
Last edited:
Back
Top