Hi, I have been making my custom leaderboard and got the Gui working for it a while ago. My app is successfully on the Apple App Store. My leaderboards have not been loading and I have been trying to fix this issue for a while now. I have tested in testflight using game_network.show(“leaderboards”,…) so I know the leaderboard is existent and it successfully sets high scores, but when I use this code:
function Load\_Scores(scope,timescope,range) --scope = "Global" or "FriendsOnly --timescope = "AllTime", "Week", or "Today"" print("Loading...") return game\_network.request("loadScores", { leaderboard = { category = 'Game.HighScore', playerScope = scope or "Global", timeScope = timescope or "AllTime", range = range or {1,25}, playerCentered = false }, listener = function(event) local d = event.data for i,k in pairs (d or {}) do print(i,k) end return event.data end }) end function Update\_Leaderboard\_Data() if not Leaderboard\_Data then Leaderboard\_Data = {} end for q,w in pairs ({"AllTime","Week","Today"}) do local t = Load\_Scores("Global",w) print(t) table.sort(t or {},function(a,b) return a.rank \< b.rank end) Leaderboard\_Data[w] = t if not Leaderboard\_Data[w] then print(w) print("No Leaderboard Data Available!!!") return end local t = {} for i,k in pairs (Leaderboard\_Data[w] or {}) do table.insert(t,k.playerID) end local playernamestbl = game\_network.request("loadPlayers", { playerIDs = t, listener = gamenetwork\_callback } ) for i,k in pairs (playernamestbl or {}) do Leaderboard\_Names[w][k.playerID] = k.alias end end end
t is nil and I never get to see the custom leaderboard i made… Any suggestions or problems I may be having? I’ve been checking my code over and over again for days now.
UPDATE: I call my leaderboard function after this, so I will see the leaderboard if there is data in the global ‘Leaderboard_Names’ array.