The problem is I have a inventory based on if the player owns the badge or not. So lets say they own a certain badge then the item appears in their inventory. But the code is outputting “TooManyRequests”.
local Badge = 238713981731
local BadgeService = game:GetService("BadgeService")
local player = "idk"
if not BadgeService:UserHasBadge(player.UserId, BadgeId) then
BadgeService:AwardBadge(player.UserId, badgeId)
end
this should work (i think), i cant test it because i am banned from roblox
That would work. But its the table loop that is making it repeat the call over and over again making it “TooManyRequests”. I want to call all the functions without it being “TooManyRequests”. Also, I dont want the player to receive the badge if they do not own it.
But if “TooManyRequests” is outputted the rest of the pcall would result in errors? That would mean that most of the items in the inventory wouldnt be loaded.
Actually I think ive found a solution. I would save each badge (BoolValue) to the datastore. And use the inventory system based of the datastore.
I will report back if this works or not.
Update: It worked like a charm. I created a boolvalue for every badge there was and assigned values to it (true if they owned it, false if they didnt). And changed my inventory script to fit these features. Thanks for the help!