How can I make custom leaderboard gui?

I wanna make leaderboard gui like in roblox but customized:
image
Everything is easy to make but I have trouble with sorting it. If I will make table.sort() every single time someone’s stat changed the game would be not optimized

Use a UIList and change the LayoutOrder of the GUI elements to the amount of coins or whatever they have (best method i could think of rn). Also table.sort wouldnt really impact the performance as it will be on the client and Roblox is already using a good algorithm for sorting.

2 Likes

limit is 999M of layoutOrder, so nah ty. I use client script to make leaderboard and already using UIList. Just need some sorting system that is optimized

How is table.sort not optimized? I’m curious.

like, it optimized, but if you will use table.sort() a lot of times in a few seconds. The game would be kinda laggy

I’m sure that using table.sort a lot is perfectly fine. Have you even benchmarked it?

yes

owgrkmwrgiwrkmlhgwjirohwkjthjiwthjiwt

alr nvm, just using table.sort() but not that often