I'm quite new to tables (although with a basic understanding) and was confused when the output would give me both 10000 and 0 when I printed the possible values but when I used math.max all I got was 0.
table.sort(ranks)
local plr = game.Players[plrName]
local highest = 0
for rank,theranks in pairs(ranks) do
if tonumber(plr:WaitForChild("leaderstats").RAP.Value) >= theranks.RAP then
print(theranks.RAP)
print(math.max(theranks.RAP))
end
end
--print(highest)
print(highest)
the script while not complete will be intended to return a players rank based on certain values.

2 comments
Hmm... Didn't seem to work. Here's my full script maybe I did something else wrong. https://pastebin.com/p669KcHk
Here's my discord: Mr. Bonesette#6850