local ClickDetector = script.Parent.ClickDetector
local Ranks = {
"Newbie",
"Novice",
"Rookie",
"Beginner",
"Talented",
"Skilled",
"Intermediate",
"Skillful",
"Seasoned",
"Proficient",
"Experienced",
"Advanced",
"Senior",
"Expert"
}
local function OnMouseClick (Player)
local level = Player.leaderstats.Level
local nextlevel = level.Value + 1
local experience = Player.stats.Experience
local maxexperience = level.Value * 100
local title = Player.leaderstats.Title
experience.Value = experience.Value + ((maxexperience * 0.1)+ 3)
print("experience : " .. experience.Value)
if experience.Value >= maxexperience then
print(experience.Value .. " is higher than or equal to " .. maxexperience)
local leftexperience = experience.Value - maxexperience
print("leftexperience : " .. leftexperience)
experience.Value = leftexperience
print("experience : " .. experience.Value )
level.Value = nextlevel
local rank = Ranks[1 + (level.Value / 5)] -- Important
title.Value = rank
end
end
ClickDetector.MouseClick:Connect(OnMouseClick)
How do i remove the decimal of the rank?
For example if the value is 3.8 then it will become 3

1 comment
adding to this you can use strings to get a more flexible result. so it would be something like this: tonumber(string.format("%.4f", "5.509453"))