So, I don’t know how to make GUI’s. But I’m making a game where I need to put pictures and if you like on the pictures they show information about the badge and how to get it. It’s kinda like the “Reggiepedia” in this game: [+3 Reggies] Find the Reggies {346} - Roblox but its diffrently themed. If you could send a script for the GUI or send a model, that would be much appreciated.
Won’t send you a script or a model since I don’t like to spoon feed but you’re welcome to try approaching this yourself! It will require some handiwork on your part.
Since Roblox doesn’t provide a way to get all badges in an experience (why…?), you can make of the Badges API to query the experience’s badges. That’s /v1/universes/{universeId}/badges. You can then decode the data which is in JSON format and then show them on a Gui.
Each badge table already provides you its image id and description parameter (you can put how to get the badge in the description or write something else), so it’s just up to you to display them on a Gui. If you need to check ownership status then UserHasBadgeAsync is there for you. Do be aware though that since this is internally a web call there’s a rate limit imposed, may be 100 requests/minute.
The pictures is the problem not the GUI
I believe I already specified.
There’s always GetBadgeInfoAsync as well if you want the information of a single badge which also contains its image id, but refer to this part:
If you aren’t looking for the badge’s image then please be more specific about what you mean by a “picture” being a problem.
If I understand what you’re saying, you are having trouble finding the badge icon’s image id? If this is the case then you could find it using GetBadgeInfoAsync which is a function of BadgeService. I have made a function that can be used to get the ImageId of a badge.
Code
local BadgeService = game:GetService("BadgeService");
local function GetBadgeIcon(Id : Int64)
local ImageId
local Success, ErrorMessage = pcall(function()
ImageId = "rbxassetid://"..BadgeService:GetBadgeInfoAsync(Id).IconImageId;
end)
if Success then
return ImageId
else
print("Failed to get badge icon : "..ErrorMessage);
end
end
Example of use
-- Example
local Part = Instance.new("Part", workspace);
Part.Size = Vector3.new(25,1,25);
Part.Position = Vector3.new(0,50,0);
Part.TopSurface = Enum.SurfaceType.Smooth;
local Decal = Instance.new("Decal", Part);
Decal.Face = "Top";
Decal.Texture = GetBadgeIcon(176685508);
I instead re-made the whole GUI and it worked out by using decals