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

Is there a way to make minimum skill levels? Tfs 0.4

Yaboihunna

New Member
Joined
Mar 27, 2019
Messages
136
Reaction score
3
Like the title says I'm trying to find out if I can make minimum skill levels depending on vocation example
Knight
Magic level 8
Axe 70
Druid
Magic level 70
And not be able to die and have lower skills than the set ammount thank you!
 
Solution
This one should work
Skills/Magic level
And add this to your data/lib/050-function.lua
Lua:
function doPlayerAddSkill(cid, skill, amount, round)
    if(skill == SKILL__LEVEL) then
        return doPlayerAddLevel(cid, amount, round)
    elseif(skill == SKILL__MAGLEVEL) then
        return doPlayerAddMagLevel(cid, amount)
    end

    return doPlayerAddSkillTry(cid, skill, (getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill)) / getConfigInfo('rateSkill'))
end
This one should work
Skills/Magic level
And add this to your data/lib/050-function.lua
Lua:
function doPlayerAddSkill(cid, skill, amount, round)
    if(skill == SKILL__LEVEL) then
        return doPlayerAddLevel(cid, amount, round)
    elseif(skill == SKILL__MAGLEVEL) then
        return doPlayerAddMagLevel(cid, amount)
    end

    return doPlayerAddSkillTry(cid, skill, (getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill)) / getConfigInfo('rateSkill'))
end
 
Last edited:
Solution
no I mean like knight would get axe sword and club 70 and cant go below that and mages would get 70 ml and paladins distance knights get 8 ml and paladins get 15
 
Try this beginner code

Lua:
local playerVoc = getPlayerVocation(cid)
function doPlayerAddSkill(cid, skill, amount, round)
    if(skill == SKILL__LEVEL) then
        return doPlayerAddLevel(cid, amount, round)
    end
    -- Magic Level for All   
    if(skill == SKILL__MAGLEVEL) then
        if playerVoc == 1 or playerVoc == 2 then
        doPlayerAddMagLevel(cid, amount)
        end
        if playerVoc == 3 then
        doPlayerAddMagLevel(cid, amount)
        end
        if playerVoc == 4 then
        doPlayerAddMagLevel(cid, amount)
        end
    end
    -- Knight Club & Axe
    if(skill == SKILL__CLUB or skill == SKILL__AXE) then
        if playerVoc == 4 then
        doPlayerAddSkill(cid, skill, amount, round)
        end
    end
    -- Paladin Distance
    if(skill == SKILL__DISTANCE) then
        if playerVoc == 3 then
        doPlayerAddSkill(cid, skill, amount, round)
        end
    end

    return doPlayerAddSkillTry(cid, skill, (getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill)) / getConfigInfo('rateSkill'))
end
 
Back
Top