Remove the ugly elseif block from the code when setting skill level.
**Instead of **
if currentValue <= 100 then
--Stuff
elseif currentValue > 100 and currentValue <= 200 then
--Stuff
end
this is what I am testing
for _, v in ipairs(Config.Skills[key].skillLevels) do
if currentValue <= v.max and currentValue >= v.min then
levelid = v.id
print(levelid)
min = v.min
max = v.max
SkillLevel = 'Level ' .. levelid .. ' - Total XP: ' .. math.round(currentValue)
end
end
**the config for this is **
lockpicking = {
icon = 'fas fa-unlock',
label = 'Lockpicking',
maxLevel = 350,
skillLevels = {
{ id = 0, max = 100, min = 0 },
{ id = 1, max = 200, min = 100 },
{ id = 3, max = 300, min = 200 }
},
messages = {
{ notify = true, level = 50, message = "You're not horrible with that lockpick anymore" },
{ notify = true, level = 100, message = "You start feeling better with that lockpick in your hand" },
{ notify = true, level = 200, message = "You're getting good with a lockpick" },
{ notify = true, level = 300, message = "You feel like you're nailing lockpicking now" },
{ notify = true, level = 350, message = "No tumbler will go untouched. You're like the Lockpicking Lawyer!" },
}
},
I thought if I was to suggest something I should properly test it myself before ask someone else to do it. Hope this helps improve the resource.

