Thank you for the extra context!
With the information you have given me, we can’t yet call this problem a “bug”, as a bug generally means there is some unexpected / undocumented behavior. If the issue is that it doesn’t work since other badges are constantly being checked by loops, then my first instinct would be that you are hitting the UserHasBadgeAsync
universe-level rate limit of 50 + 35 * [number of players] requests per minute
(see the documentation here).
This may or may not be the problem, so here are my recommended steps:
- Wrap the
UserHasBadgeAsync()
function in apcall()
. That way, you can catch any errors that might occur and print them to your console. If the issue is the rate limit, you should see the error"TooManyRequests"
. Here’s a good dev forum post describing howpcall()
works. - If this is not the case, let me know and I can take a deeper look into if this is in fact a bug. Otherwise, I would create a cache that stores if a player has a specific badge. This way, you only need to call the
UserHasBadgeAsync()
function once for each player for each badge.
Let me know if you have any questions on this!