Thanks to everybody! I tried to submit number and string and it accept both number and string (string = “numbers”). Now with print_r() it’s clear that submitHighScore and getScores are working Why, I can’t get only results.value?
simulator output:
table: 126158F0 { [1] =\> table: 126158F0 { [updated\_at] =\> "2013-04-25T11:19:47+00:00" [username] =\> "CloudPlayer75" [\_id] =\> "5177xxxxxxxxxxxxxxxxxxx02" [value] =\> 13420 [leaderboard\_id] =\> "5173xxxxxxxxxxxxxxxxxx000001" [created\_at] =\> "2013-04-24T07:10:43+00:00" [user\_id] =\> "517xxxxxxxxxxxxxxxxxx001" } [2] =\> table: 126158F0{ [updated\_at] =\> "2013-04-25T04:51:33+00:00" [username] =\> "CloudPlayer76" [\_id] =\> "5178bxxxxxxxxxxxxxxxxxxx0001" [value] =\> 1000 [leaderboard\_id] =\> "51738xxxxxxxxxxxxxxxxxx0001" [created\_at] =\> "2013-04-25T04:51:33+00:00" [user\_id] =\> "5177xxxxxxxxxxxxxxxxxxxxxx001" } } 1 nil nil 2 nil nil
local function leaderboardsListener( event ) if ( event.type == "getScores" and event.error == nil ) then local scoreStrings = {} local results = json.decode(event.response) print\_r(results) for i = 1, #results do print(i,results.username,results.value) end end end leaderboards.setListener( leaderboardsListener )