UserHasBadgeAsync: Parsed invalid JSON: "Too many requests"

but there isnt really anything i can do as the game is a pass type game and the entire thing depends on gamepasses. so i guess i cannot add any more items?

This is local script or server script?
Edit: See, local, I don’t see another option, how to make them less than 100 (99 is possible) and before starting the script, make a table where to write whether the player has a gamepass or not, and then check the table already, and not call the function

ok, thank you very much, i am going to try this now

It’s a server-side script since ServerStorage can only be accessed on the server-side

also since BadgeService:UserHasBadgeAsync only works in server script i think

Could you explain what this script is about, what is his usage, and why do you need to check if the user has all theses badges without any action from the user itself?

Yes! Maybe I didn’t look in the right place.

the script takes all the badges of the flags (find the flags game) and puts it in an organized manner in the gui and also sees if they have it which uses the badgeservice because a badge would be granted to them if they collected dont have it. also it needs to check which badges it have to make the backround in the gui green. screenshots below for reference


image

So on the client-side, you need a UI that show the user all the badges he got?

yes, that is basically all it does
edit: also there is a local script for when the player touches a hitbox of a flag it checks if he has a flag or not, if he does it will show up like this
image
and if they dont it will say congrats along with awarding them the badge

So, as for

You actually don’t need to check if the user has the badge, if you put your AwardBadge code into a pcall it will allow you to avoid the error if the user already have the badge. You could even handle it if you need to do something with it.

As for the problem with the rate limit, there is multiples approach, to name only a few. You could simply add a wait(1) and hope for it to fix the issue. You could also load badges by batch, by setting up a for or while loop waiting 1 minute before starting the next batch.

As a side note, there is a lot of others approach that would require starting from scrach by using remoteFunction or remoteEvent to do client-server interaction.

You should probably store all the badges a user has when he join the game inside a table, make a remoteFunction that check if the user have the badge in the stored table so that one of your client-side script could ask the server and get a response.

problem is i dont know how to do all this so idk what im going to do but i will try to learn how

Roblox Docs can be quite use full

where would i add this in the script

In the loop where UserHasBadgesAsync is used.

You will probaly need to load them by batch then / try using wait(0.5)

yeah but i might try the pcall thing but i dont really understand it

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