Error in organizing ranking list

I am organizing a ranking list for my game. However, it is giving an error. I fetch the list from Firebase and try to sort it in my game in the form of a list.


Thank you in advance

immagine

You’re evaluating if
example, /Usuario is equal to select item, returning true/false,
Remove the green conditional block and put directly select list item.

I did what you advised me, and it worked.But now it’s returning the value 0 and empty.So the get value for key is not fetching the correct value.

So now we’re reading the data correctly, even if it returns a value when not present.

Add a message dialog to see what you receive in RecebeuValor(valor).

What is on top is the returned value.

infact, not a properly formatted dictionary

I managed to fix it. I just needed to delete the / and everything was resolved.

I needed to erase the “Marcos” because it was coming.

1 Like

The ranking is showing, but it’s out of order. I think the block I used to adjust the ranking is not working. I need some extension that works to help organize my ranking from highest to lowest in terms of points.

Hi Marcos,

Try this,

I pull the punctuation first and then the user’s nickname. After it is organized, I do the reverse. However, what I was using is not organizing the list.

I was using this block, but it is not working for the way I use it. The ranking remains the same with the block or without the block.

image

It worked?

No :rofl:.
The order of the nickname was inverted with the punctuation. But the ranking order remained the same.

Here, for each element in the dictionary, you are creating a list with
index 1 Score
index 2 User

Isn’t the resulting list like this one?

But the way I pull from Firebase, I can’t do it like you showed. Because I don’t know how many users there are, and there’s no way for me to add them one by one. By adding it the way I did, I can pull all the users and associate each user with their correct score. If I do the inclusion differently, it will mess up the users with their scores. I would need an extension that took my list and sorted it by index 1, pulling index 2 along with it.

:grin:

It worked. Thank you very much. :grin:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.