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

Unable To Level Up Without Storage

ibkfly

New Member
Joined
Jan 1, 2010
Messages
69
Reaction score
4
Hey, I was wondering if anyone has any idea how to make it so you cant level up without a certain storage value? Im thinking about making it impossible to gain experience at level 500 without completing a promotion quest. When you are promoted, you are able to gain experience again.

Cheers!

TFS 1.1 Client 10.70
 
Solution
I dont know if this works or not, but maybe this works same as onHealthChange function, may you need to add this:

Lua:
function Player:onGainExperience(source, exp, rawExp)
    if self:getStorageValue(SOME_STORAGE_ID) <= 0 and self:getLevel() >= 500 then
        return 0
    end
    return source, exp, rawExp --Only this lines
end

Kind regards!
event\player.lua
Code:
function Player:onGainExperience(source, exp, rawExp)
    if self:getStorageValue(SOME_STORAGE_ID) <= 0 and self:getLevel() >= 500 then
        return false
    end
...
end
 
I dont know if this works or not, but maybe this works same as onHealthChange function, may you need to add this:

Lua:
function Player:onGainExperience(source, exp, rawExp)
    if self:getStorageValue(SOME_STORAGE_ID) <= 0 and self:getLevel() >= 500 then
        return 0
    end
    return source, exp, rawExp --Only this lines
end

Kind regards!
 
Last edited by a moderator:
Solution
I dont know if this works or not, but maybe this works same as onHealthChange function, may you need to add this:

Lua:
function Player:onGainExperience(source, exp, rawExp)
    if self:getStorageValue(SOME_STORAGE_ID) <= 0 and self:getLevel() >= 500 then
        return false
    end
return source, exp, rawExp --Only this lines
end

Kind regards!
how i can add for players don't up from lvl 8 to lvl 500 killing one monster
 
how i can add for players don't up from lvl 8 to lvl 500 killing one monster
May you need to put less experience on "Server/data/xml/stages.xml" or if it's disabled, you can find it on your config.lua file, some line like this:
Lua:
-- Rates
-- NOTE: rateExp is not used if you have enabled stages in data/XML/stages.xml
rateExp = 5

Code:
<?xml version="1.0" encoding="UTF-8"?>
<stages>
    <config enabled="1" />
    <stage minlevel="1" maxlevel="99" multiplier="800" />
    <!--
    This mean if a player kill a monster from level 1 to 99 the player will take x800 expierence
    a rat gives 5 of experience, but with this multiplier the rat gives 4000   
    -->
        <stage minlevel="100" maxlevel="199" multiplier="200" />
    <!--
    But in this case if the player grow up in level, (100 to 199) the player will take x200 expierence
    a rat gives 5 of experience, but with this multiplier the rat gives 1000   
    -->
    <stage minlevel="200" multiplier="5" />
    <!--
    And in this case the player of level 200 or more, will take x5 expierence
    a rat gives 5 of experience, but with this multiplier the rat gives 25
    -->
</stages>

And if there are more than 5, may you need to put less multiplier, this means that monster gives 5 times more exp than monsterName.xml file says, ex.
In "server/data/monsters/demons/demon.xml" there are a line that means how many experience the demon will give, in the normal case the exp of demon are: experience="6000", but with this miltipliers, this means the demon will give experience="35000".
 
May you need to put less experience on "Server/data/xml/stages.xml" or if it's disabled, you can find it on your config.lua file, some line like this:
Lua:
-- Rates
-- NOTE: rateExp is not used if you have enabled stages in data/XML/stages.xml
rateExp = 5

Code:
<?xml version="1.0" encoding="UTF-8"?>
<stages>
    <config enabled="1" />
    <stage minlevel="1" maxlevel="99" multiplier="800" />
    <!--
    This mean if a player kill a monster from level 1 to 99 the player will take x800 expierence
    a rat gives 5 of experience, but with this multiplier the rat gives 4000  
    -->
        <stage minlevel="100" maxlevel="199" multiplier="200" />
    <!--
    But in this case if the player grow up in level, (100 to 199) the player will take x200 expierence
    a rat gives 5 of experience, but with this multiplier the rat gives 1000  
    -->
    <stage minlevel="200" multiplier="5" />
    <!--
    And in this case the player of level 200 or more, will take x5 expierence
    a rat gives 5 of experience, but with this multiplier the rat gives 25
    -->
</stages>

And if there are more than 5, may you need to put less multiplier, this means that monster gives 5 times more exp than monsterName.xml file says, ex.
In "server/data/monsters/demons/demon.xml" there are a line that means how many experience the demon will give, in the normal case the exp of demon are: experience="6000", but with this miltipliers, this means the demon will give experience="35000".
thanks for explain, i know confings in stages, i need other config
thanks again
 
Back
Top