for i,v in pairs(game.Players:GetPlayers()) do
t1 = {}
KO = v.leaderstats.KOs.Value
table.insert(t1,#t1+1,KO)
end
table.sort(t1)
print(t1[#t1])
is part of
local GameModes = {}
function FreeForAll()
for i,v in pairs(game.Players:GetPlayers()) do
Firefox = {}
zenox = v.leaderstats.Value
table.insert(Firefox,zenox, #Firefox + 1)
table.sort(Firefox)
print(Firefox[#Firefox])
end
end
function MultiTeam()
end
function Choosemode(Mapchosen)
if Mapchosen == "Sol2" then
FreeForAll()
print("Sol2")
end
if Mapchosen == "ArenavonOsterreich" then
MultiTeam()
print("ArenavonOsterreich")
end
end
return GameModes
So I'm trying to get the player with the highest KO value right?
Problem is, It's not working,
The highest value of KOs is 5, yet it prints "0" instead No errors in the output.
Help me out here. Thanks in advance

4 comments
is this the whole of your code? and you can use the unpack method to see the content of a table e.eg print(unpack(t1))
Yeah it is, it's part of a module script.
Can you put all of the module script in?
Hey if you think it would help, fine