• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Removing skills (club, shielding, etc...)

Hernest

New Member
Joined
Jul 26, 2010
Messages
152
Reaction score
3
Location
poland
So, I want to set player skills to 10 when he use command, but something is wrong with it.
doPlayerAddSkill(cid,0, 3) <- works fine, +3 fist fighting
doPlayerAddSkill(cid,0, -3) <- nothing happend, fisting is on same lvl before and after

There are no errors in console.
TFS 0.4
 
This function doPlayerAddSkill:
Code:
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

Does not work to REMOVE skills, you can do it but updating the database. Kick the player and run the query to change the skills you need.
 
Back
Top