So I’ve been working on a TD type of game, and I wanted to make a wins leaderboard. The problem is, the wins are stored in a table. I do not know how to make a global leaderboard with tables. Any help would be great!
Just grab the value you need from the table
But how would i sort it from biggest to smallest? (without using :GetOrderedAsync)
Im not too sure, why not use GetOrderedAsync?
I just realized… AAAAAAAAAAAAAAAAAAA
I mean you could use
table.sort(Table, function(a,b)
return a > b
end)
But im not too sure if that would actually help or not
Nevermind, I can’t use :GetOrderedAsync because I cant get a specific value from a table.
what kind of data do you store in your table?
example :
playerData = {
["Coins"] = 0,
["Wins"] = 0,
["Losses"] = 0,
["SelectedTowers"] = {"Thrower Cube"},
["OwnedTowers"] = {"Thrower Cube"},
}
Ohhhh
playerData = {
["Coins"] = 0,
["Wins"] = 1,
["Losses"] = 0,
["SelectedTowers"] = {"Thrower Cube"},
["OwnedTowers"] = {"Thrower Cube"},
}
print(playerData.Wins)
This gets the Wins from the playerData.
You could save just the wins into a seperate DataStore and then use that for the leaderboard. Its what I did for my game.
oh, okay then, ill try it out!
I’m just not gonna make a leaderboard, thank you to everyone that tried to help!