Problems to get score > 100

Hi everyone,

I just added to my game a ranking score but only shows score < 100. How can I do to get the score greater than 100?

I am using firebase to save the player and the score. The code I have its this:

Any idea? Thanks in advance for help!

Are those scored being saved? Can you show screen snips of where you’re saving the data? And what happens if you don’t limit the query to 5 records?

Thanks for replying! Yes, the score and players are saving.

The data is saving in a global variable “jugador” define as structure "player: " and "score: "

If I dont limit the query show me only the score < 100…

So you’ve managed to check FireBase and see the values in there? Also, when you write to FireBase, you’re not checking the result. How do you know if it’s succeeded?

If you show all the scores, and they’re all less than 100, then that suggests there are no scores getting saved that are over 100.

Can I suggest you put add an event to write a test name with a score of 150, and see if that gets read in (yes, hard code a score getting added).

----So you’ve managed to check FireBase and see the values in there?

Yes, the values are there even the scores >100. When I saw that I had players with 114 or 120 score in firebase, I realized that the ranquing is not show those records.

—Can I suggest you put add an event to write a test name with a score of 150, and see if that gets read in (yes, hard code a score getting added).

I did this experiment and …add and write to firebase fine. That’s why I dont get what happens.

I’m curious on how FireBase works when a query is run multiple times.

With the event from your first post, is that being called multiple times? Can you put a trigger once on the first event, and make the second event a subevent off it, so it the whole lot only gets run once?

Sorry, we’re scratching a bit here, because I can’t see an issue with your query.

Not sorry, thank you for your help!

---- With the event from your first post, is that being called multiple times?

I only call one time when the player finish and write its name.

-----Can you put a trigger once on the first event, and make the second event a subevent off it, so it the whole lot only gets run once?

I just tried, the raquing doesn’t show anything :confused:

Are there any settings on the FireBase side that coul dbe affcting the result sets?

Are you able to clear out the database and start afresh? And see what happens as you add a new score once you have 5 in there?

1 Like

Multiple users similar issues, because they stored the score as a string and not as a number, so the ordering is made alphabetically instead of by the biggest number. That would make scores like 100 go at the bottom since the first “letter” 1 is smaller than the first “letter” 9 from 90.

Make sure you store your scores as numbers, not strings.

2 Likes

Sorry for delay answer I was trying what you told me @MrMen and @arthuro555 . Now I just fixed!!!

The score was saved as string thats why it didnt appear as I expected.

Thnk you so much you both for replaying and helping me!!!