Making Simple Badges

NOTE: BADGES COST 100 ROBUX TO CREATE!
Hello everyone! I’m Notrealac0unt, (Ignore the missing c in account)
I was surprised to see that there are hardly any tutorials on creating badges. Badges, in my opinion, are essential for your game. They provide a purpose to grind, come back to your game, or just to try and get it. The purpose of this tutorial is to hopefully help you learn how to create a badge and come up with some unique ideas on what your badge should be! With that out of the way, let’s get into it.
Part 1 - The Badges


For the sake of this tutorial I thought we could create two simple badges.

  1. You played the game
  2. You played the game for x amount

Both are simple to create and are straight forward on how to earn them.
Part 2 - Badge Art
This is by far an essential part of a badge. It gives your badge flare and sometimes a reason to earn it so it looks nice on your profile! Badges are created here under the badges category. As of now we have no art for our badge, badges are required to be at least 150x150 pixels and in the shape of a circle. Here is the process,

  1. Create a new image (I will be using paint.net as it’s free to use and simple to get the hang of)
  2. Make your image 150x150
  3. Use the circle select tool from one corner to the other to create the circle design, press backspace to fill the circle with any color, (this will make it simple to select the circle with selection tools)
  4. Now design your badge however you’d like it! For the sake of this tutorial I will show you the finished product of mine.
    B1 B2
    True works of art wouldn’t you say!
  5. Once your badges are finished upload them to Roblox and pay the 100 Robux fee to create them.
    IMPORTANT: MAKE SURE YOU SELECT THE CORRECT GAME WHEN UPLOADING THEM

Part 3 - Scripting the Badge
Now comes the fun part! SCRIPTING (What? you thought the badge would work the second you uploaded it? If only it was that easy…)
This segment will be in two parts, one for the Played badge and the other for playing a certain amount of time.
Badge 1 - You Played!
This one if by far the easiest,

  1. Create a script in ServerScriptService
  2. Follow along!
-- // Let's begin \\--
local BadgeService = game:GetService("BadgeService") -- this gets the service used for badges
local PlayedBadge = 123456 -- replace the numbers with your badge id found after you create it

game.Players.PlayerAdded:Connect(function(player) -- checks when a player joins
     if not BadgeService:UserHasBadgeAsync(player.UserId,PlayedBadge) then -- they don't have the badge
        BadgeService:AwardBadge(player.UserId,PlayedBadge) -- Award the player the badge! 
    end
end)

Just like that we created our first simple badge! Not to shabby?
Badge 2 - You played for 1 minute
For the sake of our time badge we’ll make it where they need to play for one minute. I’ll add on to our existing code.

-- // Let's begin \\--
local BadgeService = game:GetService("BadgeService") -- this gets the service used for badges
local PlayedBadge = 123456 -- replace the numbers with your badge id found after you create it
local OneMinuteBadge = 654321

game.Players.PlayerAdded:Connect(function(player) -- checks when a player joins
   if not BadgeService:UserHasBadgeAsync(player.UserId,PlayedBadge) then -- they don't have the badge
        BadgeService:AwardBadge(player.UserId,PlayedBadge) -- Award the player the badge! 
    end
    --// Time Badge \\--
    if not BadgeService:UserHasBadgeAsync(player.UserId,OneMinuteBadge) then -- checks if they DON'T have the badge
        while player do -- while the player is here
            wait(60)
            if player then
                if not BadgeService:UserHasBadgeAsync(player.UserId,OneMinuteBadge) then
                    BadgeService:AwardBadge(player.UserId,OneMinuteBadge) 
                    break -- break out of the loop
                end
            end
        end
    end
end)

Just like that we’ve created two simple badges!
Important Notes

  1. Make sure your badge is active (found in configure once you select your badge)
  2. Make sure it’s obtainable in your game
  3. There are many other ways of awarding players a badge, my examples may not suite your style of coding and you can always change it however you like it, these are just basic examples!
  4. More examples and documentation on Badges and BadgeService can be found here

Overall, hopefully you learned something new and have a new understanding on creating badges! If this tutorial wasn’t of assistance here are some Youtube links for badges and scripting in general,
Tutorial by Eppobot, AlvinBlox Scripting Youtube Channel, TheDevKing youtube channel

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

0 voters

Was this tutorial helpful? 1 - God awful through 10 - Super good!

66 Likes

Honestly, this is the best way to make a badge! Your really good at what you do man! :smiley:

10 Likes

A good tutorial for newer developers looking on how to make badges, and especially crediting some YouTubers who made a tutorial on these as well! :+1:

5 Likes

Note that after the 60 seconds finish there is no assurance that the player is still in the game, and the script will throw an error if the player left.

9 Likes

Thanks for this! May become useful in the future

3 Likes

This tutorial is great that it teaches new developers how to make both a thumbnail and a working script for a badge. Well done!

4 Likes

Does this work by any chance I wanted to try the script out and learn off it as i’m very not the best at scripting.

1 Like

Wouldn’t it also attempt to award the badge again every 60 seconds? As long as the player isn’t gone?

1 Like

Suggest just using this that I scripted, Just a simple modification

if not BadgeService:UserHasBadgeAsync(player.UserId,OneMinuteBadge) then -- checks if they DON'T have the badge
        while wait(60) do -- while the player is here
            if player then
            if not BadgeService:UserHasBadgeAsync(player.UserId,OneMinuteBadge) then
            BadgeService:AwardBadge(player.UserId,OneMinuteBadge)  
              end
            end
        end
    end
5 Likes