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

Solved calling skill level and failing

shivaria

Active Member
Joined
Sep 2, 2009
Messages
158
Reaction score
36
SOLVED: When using Shield Skills, always "getEffectiveSkillLevel" and not "getSkillLevel"
Wish I knew about this before! lol

Does anyone know why these two different codes arent giving an accurate shield level when calling for it?
TFS 1.1
10.77

Code:
local config = {
    db_table = 'players',
    db_pointsColumn = 'skill_shielding',
    db_idColumn = 'id',
}
local shieldLevel = db.storeQuery("SELECT `"..config.db_pointsColumn.."` FROM `"..config.db_table.."` WHERE `"..config.db_idColumn.."` = "..player:getAccountId())
Code:
local shieldLevel = player:getSkillLevel(cid, SKILL_SHIELD)

Im using this to call for it
Code:
function equalsRandomNumber(num)
    return math.floor(math.random(1, num)) == 1
end

function returnMinMax(min, max, value)
    return min <= value and max >= value
end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)

if returnMinMax(1, 3, shieldLevel) then
            if equalsRandomNumber(5) then
 
Last edited:
Back
Top