How to get all badges in place

I need to get all badges in place to make them visible while in-game (not website only), but idk how to do that

I tried to search for that in dev forum but I couldn’t find anything

Am a little confused what you mean do you mean how to create one or are you I said they get it in the game?

example:
My game have 5 badges and I need to get all these badges in-game to show them in gui (I just need script to get list of badges)

  1. Here you have an example, it is when you get to the platform where the script is

    Script
local BadgeService = game:GetService("BadgeService")
local BadgeId = 0

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") and game.Players:FindFirstChild(hit.Parent.Name) then
		local Player = game.Players[hit.Parent.Name]
		BadgeService:AwardBadge(Player.UserId, BadgeId)
	end
end)

I dont need award badge, I need to get all badges that exist at place, like if I have 5 badges in place, I get all 5 through script, is this possible?

As I understand it, you have to get them all at the same time, I understand you correctly?

I think he means a page to view badges like super bomb survival

@ameliacool257 he’s right, I need this xd (I will create a gui which will contain all badges for view but I need to get them from website first)

I think it would just be easier download the badge images and just re upload them to roblox and just insert them without code

but if I will have a lot badges, I have to add them myself and im lazy

I couldn’t find something that I want in there

Ok here’s screenshot


And I need to get all badges in-game through script (Like in a table)

local game = game
local playersService = game:GetService("Players")
local badgeService = game:GetService("BadgeService")
local player = playersService.LocalPlayer

local badgeIds = {1, 2, 3, 4, 5} --replace with ids of your badges

for _, badgeId in ipairs(badgeIds) do
    local badgeInfo = badgeService:GetBadgeInfoAsync(badgeId)
    print(badgeInfo.Name) --name of badge
    print(badgeInfo.Description) --description of badge
    print(badgeInfo.IconImadeId) --icon of badge
    local hasBadge = badgeService:UserHasBadgeAsync(player.UserId, badgeId)
    print(hadBadge) --true or false
end
1 Like

Then you should not be lazy, it is not a good idea to get all the badge information from Roblox for every single badge for every single user. You should have a local storage of your badges, and also save the badges the user owns with DataStore. Not by getting all the badges they have unlocked with the API.

This works? I can’t test right now

I never said I will get for all users or something, I just need to know how to do that. looks like its easier to make custom badges system

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