Badges are rewards you give players for reaching milestones in your game

A badge in Roblox is a digital achievement that appears on a player's profile when they complete a specific task in your game. You create the badge itself in Roblox Studio, set the image and description, then write code that awards it when a player meets your condition — defeating a boss, collecting 100 coins, surviving 10 minutes, or anything else you define.

The badge system is built into Roblox and costs nothing. Once you create a badge, it stays with the player permanently and shows on their profile, giving them a reason to keep playing and try different challenges in your game.

Key Takeaways

  • You create badges in Roblox Studio by going to the Badges tab, clicking Create Badge, and uploading a 512×512 pixel image.
  • Each badge needs a name, description, and a unique ID number that Roblox generates automatically when you save it.
  • You award badges using a script that calls the BadgeService and checks whether the player has already earned it.
  • The most common mistake is forgetting to enable the badge in Studio before trying to award it in your game.
  • Test badges in a local server or with a friend before publishing your game to make sure the code works.

Create a new badge in the Badges tab

Open your game in Roblox Studio and look for the Badges tab in the top menu bar. Click it, then click the Create Badge button. A window opens asking for a name — this is what players see on their profile, so make it clear and short, like "First Victory" or "Coin Collector".

Upload a 512×512 pixel image for the badge icon. This image appears on the player's profile and in your game's badge list, so make it visually distinct. Roblox accepts PNG, JPG, and GIF files. Write a description in the text box below — something like "Defeat the final boss" or "Collect all hidden coins". Click Create, and Roblox assigns the badge a unique ID number automatically. Write this ID down or copy it; you will need it in your script.

Write a script that awards the badge when a condition is met

The script that awards a badge lives in ServerScriptService and uses the BadgeService. Here is the basic structure: the script listens for an event (a player touching a part, reaching a location, or defeating an enemy), checks if that player already has the badge, and awards it if they do not.

Start with this template and replace the parts in brackets with your own values:

local BadgeService = game:GetService("BadgeService") local badgeID = [YOUR_BADGE_ID_HERE] local touchPart = game.Workspace.[NAME_OF_YOUR_PART] touchPart.Touched:Connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid then local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then if not BadgeService:UserHasBadge(player.UserId, badgeID) then BadgeService:AwardBadge(player.UserId, badgeID) end end end end)

This script waits for something to touch the part. When it does, it checks whether the touching object is a player character (by looking for a Humanoid). If it is, it gets the player object, checks whether they already own the badge, and awards it if they do not. The check prevents the script from trying to award the same badge twice.

Use different triggers for different badge types

The script above uses a touch trigger, but you can award badges for many different events. If you want to award a badge when a player reaches a certain score, listen to a value change instead. If you want to award it when they defeat an enemy, trigger it from the enemy's death script. If you want to award it after they survive for a set time, use a timer.

The key part stays the same: get the player object, check if they have the badge, and call AwardBadge if they do not. The only thing that changes is what event you listen to. For example, a time-based badge might look like this:

local BadgeService = game:GetService("BadgeService") local badgeID = [YOUR_BADGE_ID_HERE] local requiredTime = 600 -- 10 minutes in seconds game.Players.PlayerAdded:Connect(function(player) local startTime = tick() while player.Parent do wait(1) if tick() - startTime >= requiredTime then if not BadgeService:UserHasBadge(player.UserId, badgeID) then BadgeService:AwardBadge(player.UserId, badgeID) end break end end end)

This script tracks how long a player has been in the game and awards the badge after 10 minutes. You can modify the requiredTime value to any number of seconds you want.

Enable the badge before testing

Before you test your game, go back to the Badges tab in Studio and make sure your badge shows an "Enabled" status. If it says "Disabled", click the three dots next to the badge name and select Enable. Disabled badges cannot be awarded, even if your script is correct.

Once it is enabled, run your game in Studio using the Play button. Trigger the condition that should award the badge — touch the part, reach the score, or wait the required time. If the script works, the badge appears in your inventory. You can check this by going to your Roblox profile in a web browser and looking at your badges.

Test with a friend or a local server

Testing alone in Studio can hide problems because Studio behaves differently from a live game. The most reliable way to test is to publish your game, join it with a second account (or ask a friend to join), and trigger the badge condition. Watch the other player's profile to confirm the badge appears.

If the badge does not appear, check three things: first, make sure the badge is enabled in the Badges tab. Second, verify that the badge ID in your script matches the ID shown in Studio — copy and paste it to avoid typos. Third, check the Output window in Studio for error messages while the game runs; these often point to what went wrong in the script.

Common mistakes and how to fix them

The most frequent error is forgetting to enable the badge. If your script runs but the badge never appears, the Badges tab is the first place to check. The second mistake is a mismatched badge ID — if you copy the ID wrong or use a different badge ID in the script than the one you created, the script will try to award a badge that does not exist.

A third issue is placing the script in the wrong location. Badge-awarding scripts must live in ServerScriptService, not in a LocalScript or in the Workspace. LocalScripts run only on the player's client and cannot award badges. The fourth mistake is not checking whether the player already has the badge before awarding it. If you skip the UserHasBadge check, the script tries to award the badge every time the condition is met, which wastes resources and can cause lag.

Frequently Asked Questions

Can I change a badge image or description after I create it?

Yes. Go to the Badges tab, find the badge, click the three dots, and select Edit. You can change the name, description, and image. The badge ID never changes, so your script continues to work without any edits.

What image size should my badge be?

Roblox recommends 512×512 pixels. Smaller images may look blurry on player profiles, and larger images take longer to load. PNG format works best because it supports transparency, which lets you create badges with non-rectangular shapes.

Can I award a badge to multiple players at once?

No. BadgeService awards badges one player at a time. If you want to give a badge to everyone in the game, loop through all players and call AwardBadge for each one, but this is rarely necessary — badges are usually earned individually through gameplay.

What happens if a player leaves the game before the badge is awarded?

If the player disconnects before your script finishes running, the badge is not awarded. The next time they join and meet the condition again, the script will award it then. There is no way to award a badge retroactively to a player who is not in the game.

Do I need to publish my game for badges to work?

Badges work in Studio during testing, but they only appear on a player's real profile if the game is published. If you are testing with a friend, publish the game first so the badge system connects to the real Roblox servers.