So what I'm trying to accomplish with this script is to see if a player has a badge listed in the table, and then add a leaderstat value based on that. But I'm not sure what to do after this point.
local bs = game:GetService('BadgeService')
local badgeList = {
'badge id here',
'badge id here',
'badge id here'
}
game.Players.PlayerAdded:Connect(function(player)
bs:UserHasBadgeAsync(player.UserId, ???)
end)

9 comments
Well, the script works but it capped the value at 1 for some reason
Wdym by that? Can you describe how you want the script to work?
So basically, i have a game where you beat these little minigames/obbies for badges. And when you beat one you get a badge. So with that in mind, i wanted to make a script which counted how many total minigames/obbies you've beaten.
Oh ok, I can edit the script. What did you mean by it capping at 1? It's not going down the rest of the table past the 1st string?
By capping at 1, i meant the leaderstat i set stopped at 1 instead of continuing, so it probably didn't finish the rest
Okay I edited it. I'm not sure if it's going to work. Let me know if it does
It worked, thanks!
No problem, happy to help
I've changed two lines of the script to make it more efficient. If you want, you can apply them. Set value = i and remove the line that adds 1 to the value.