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

Very important special script [LOOK NOW]

ugurdrahs

New Member
Joined
May 6, 2010
Messages
555
Reaction score
2
Location
Netherland
Hello,

Players that under the protection level, like level 80< wont lose any items, and after that level everything is normal for him like he can lose the items.

Someone know how to make it like that?


repp+
 
Last edited:
creature script:
Lua:
local array = {    
    PLAYERLOSS_EXPERIENCE,
    PLAYERLOSS_MANA,
    PLAYERLOSS_SKILLS,
    PLAYERLOSS_CONTAINERS,
    PLAYERLOSS_ITEMS
}

function onPrepareDeath(cid, deathList)
    if getPlayerLevel(cid) < 80 then
        for i = 1, #array do
            doPlayerSetLossPercent(cid, array[i], 0)
        end
    end
    return true
end

function onAdvance(cid, skill, oldLevel, newLevel)
    if skill == SKILL__LEVEL and newLevel == 81 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'From this new level onwards you can lose experience, items and skills if you are killed.')
    end
    return true
end

function onLogin(cid)
    registerCreatureEvent(cid, "lessdeath")
    registerCreatureEvent(cid, "adv81")
    return true
end

creaturescript.xml:
Lua:
<event type="preparedeath" name="lessdeath" event="script" value="bless.lua"/>
        <event type="advance" name="adv81" event="script" value="bless.lua"/>
        <event type="login" name="register2" event="script" value="bless.lua"/>

With that you won't lose anything (lvl, skills, mana, items)
 
creature script:
Lua:
local array = {    
    PLAYERLOSS_EXPERIENCE,
    PLAYERLOSS_MANA,
    PLAYERLOSS_SKILLS,
    PLAYERLOSS_CONTAINERS,
    PLAYERLOSS_ITEMS
}

function onPrepareDeath(cid, deathList)
    if getPlayerLevel(cid) < 80 then
        for i = 1, #array do
            doPlayerSetLossPercent(cid, array[i], 0)
        end
    end
    return true
end

function onAdvance(cid, skill, oldLevel, newLevel)
    if skill == SKILL__LEVEL and newLevel == 81 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'From this new level onwards you can lose experience, items and skills if you are killed.')
    end
    return true
end

function onLogin(cid)
    registerCreatureEvent(cid, "lessdeath")
    registerCreatureEvent(cid, "adv81")
    return true
end

creaturescript.xml:
Lua:
<event type="preparedeath" name="lessdeath" event="script" value="bless.lua"/>
        <event type="advance" name="adv81" event="script" value="bless.lua"/>
        <event type="login" name="register2" event="script" value="bless.lua"/>

With that you won't lose anything (lvl, skills, mana, items)

thanks alot dude,
repp+ for u
 
Last edited:
Check with this one.

Lua:
local array = {    
    PLAYERLOSS_EXPERIENCE,
    PLAYERLOSS_MANA,
    PLAYERLOSS_SKILLS,
    PLAYERLOSS_CONTAINERS,
    PLAYERLOSS_ITEMS
}

function onPrepareDeath(cid, deathList)
    if getPlayerLevel(cid) < 80 then
        for i = 1, #array do
            doPlayerSetLossPercent(cid, array[i], 0)
        end
    end
    return true
end

function onAdvance(cid, skill, oldLevel, newLevel)
    if skill == SKILL__LEVEL and newLevel == 80 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'From this new level onwards you can lose experience, items and skills if you are killed.')
    end
    return true
end

function onLogin(cid)
    registerCreatureEvent(cid, "lessdeath")
    registerCreatureEvent(cid, "adv80")
    return true
end

Lua:
<event type="preparedeath" name="lessdeath" event="script" value="bless.lua"/>
<event type="advance" name="adv80" event="script" value="bless.lua"/>
<event type="login" name="register2" event="script" value="bless.lua"/>
 
Check with this one.

Lua:
local array = {    
    PLAYERLOSS_EXPERIENCE,
    PLAYERLOSS_MANA,
    PLAYERLOSS_SKILLS,
    PLAYERLOSS_CONTAINERS,
    PLAYERLOSS_ITEMS
}

function onPrepareDeath(cid, deathList)
    if getPlayerLevel(cid) < 80 then
        for i = 1, #array do
            doPlayerSetLossPercent(cid, array[i], 0)
        end
    end
    return true
end

function onAdvance(cid, skill, oldLevel, newLevel)
    if skill == SKILL__LEVEL and newLevel == 80 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'From this new level onwards you can lose experience, items and skills if you are killed.')
    end
    return true
end

function onLogin(cid)
    registerCreatureEvent(cid, "lessdeath")
    registerCreatureEvent(cid, "adv80")
    return true
end

Lua:
<event type="preparedeath" name="lessdeath" event="script" value="bless.lua"/>
<event type="advance" name="adv80" event="script" value="bless.lua"/>
<event type="login" name="register2" event="script" value="bless.lua"/>


u;ve justchanged the 81 to 80...
still not working
 
Back
Top