There's no way this function is as compact as I can get it to be. Would anyone be able to help me learn how to do this process more efficiently?
local function getRank(plr)
local lvl = plr.leaderstats.Level.Value
local r = Instance.new("StringValue", plr:WaitForChild("leaderstats"))
if lvl < 10 then
r.Value = "Intern Elf"
elseif lvl >= 10 and lvl < 20 then
r.Value = "Junior Elf"
elseif lvl >= 20 and lvl < 30 then
r.Value = "Apprentice Elf"
elseif lvl >=30 and lvl < 40 then
r.Value = "Professional Elf"
elseif lvl >= 40 and lvl < 50 then
r.Value = "Experienced Elf"
elseif lvl >= 50 and lvl < 60 then
r.Value = "Senior Elf"
elseif lvl >= 60 and lvl < 70 then
r.Value = "Supervisor Elf"
elseif lvl >= 70 and lvl < 80 then
r.Value = "Master Elf"
elseif lvl >= 80 and lvl < 90 then
r.Value = "Grand Master Elf"
elseif lvl >= 90 then
r.Value = "Santa's Assistant"
end
end

1 comment
Do you really need to compact it more?