This is inside the textlabel in an localscript. It have to count the badges and create a value only in the script and change the text of the amout a player has of the badges.

player = game.Players.LocalPlayer
local BadgeService = game:GetService("BadgeService")
local badges  = {229929415, 229929797, 229929912, 229929992, 229930375, 229930543}

local function countBadges(player)
    local numBadges = 0
    for _, badge in next, badges do
        if BadgeService:UserHasBadge(player.UserId, badge) then
            numBadges = numBadges + 1
        end
    end
    return numBadges
end
while true do
script.Parent.Text = countBadges(player).."".."/6"
wait()
end

What is wrong? Thank you

1 comment

0

Try putting the countBadges(player) in a tostring(), because there is a small chance it could bug. Also, there is no need for the .."".., just make it .."/6". Also, what does the output say? It may not work instantly because it needs to contact the ROBLOX server.