#CW-REP Improvement

1 messages · Page 1 of 1 (latest)

merry scaffold
#

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.

little ferry
#

I was actually thinking of doing just this. The hard coded levels were just a mz-skill thing that came along. Good suggestions thumbup

and yeah for sure. The mz-skill formatting looks trash PepeLaugh

merry scaffold
#

👍

little ferry
#

Decided to add some more suff to this btw