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.
- You played the game
- 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,
- Create a new image (I will be using paint.net as it’s free to use and simple to get the hang of)
- Make your image 150x150
- 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)
- Now design your badge however you’d like it! For the sake of this tutorial I will show you the finished product of mine.
True works of art wouldn’t you say!
- 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,
- Create a script in ServerScriptService
- 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!
- Make sure your badge is active (found in configure once you select your badge)
- Make sure it’s obtainable in your game
- 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!
- 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
Was this tutorial helpful? 1 - God awful through 10 - Super good!