We use cookies on this site to enhance your user experience
Collapse Sidebar


AwardBadge will grant a player a badge given a Player's Player/UserId|UserId and a badge ID. In order to successfully award a badge, the following criteria must be met:

  • The player must be presently connected to the game.
  • The player must not already have the badge.*
  • Badges must be awarded on the server, i.e. from a Script or ModuleScript eventually required by a Script, instead of a LocalScript
  • Only Roblox game servers may award badges, i.e. badges cannot be awarded in Studio.
  • The badge must be awarded in a place that is part of the game associated with the badge (checked using BadgeService/IsLegal|IsLegal)
  • The owner of the place must also own the badge, i.e. the owner must not have deleted the badge.
  • The badge must not have been disabled (checked using BadgeService/IsDisabled|IsDisabled).

A player may delete an awarded badge from their inventory and be awarded the badge again.

See also

  • BadgeService/GetBadgeInfoAsync
  • BadgeService/AwardBadge
  • BadgeService/UserHasBadgeAsync


Name Type Default Description

The Player/UserId of the user the badge is to be awarded to

The ID of the badge to be awarded


Return Type Summary

True if the badge was rewarded successfully.

Code Samples

Awarding a Badge

This code sample includes a simple function for awarding a badge.

    local BadgeService = game:GetService("BadgeService")
    local function awardBadge(player, badgeId)
    	-- check badge can be awarded
    	if BadgeService:IsLegal(badgeId) and not BadgeService:IsDisabled(badgeId) then
    		-- award badge
    		BadgeService:AwardBadge(player.UserId, badgeId)

Met the Creator Badge

The following code sample gives an example of a ‘met the creator’ badge system. This script will award a specified badge (BADGE_ID) to anyone who is in a server at the same time as the user associated with OWNER_ID.

    local BadgeService = game:GetService("BadgeService")
    local Players = game:GetService("Players")
    -- change these
    local OWNER_ID = 212423 -- can use game.CreatorId for published places
    local BADGE_ID = 1
    local ownerInGame = false
    local function playerAdded(newPlayer)
    	if newPlayer.UserId == OWNER_ID then
    		-- if new player is the owner, set ownerInGame to true and give everyone the badge
    		ownerInGame = true
    		for _, player in pairs(Players:GetPlayers()) do
    			-- don't award the owner
    			if player ~= newPlayer then
    				BadgeService:AwardBadge(player.UserId, BADGE_ID)
    	elseif ownerInGame then 
    		-- if the owner is in the game, award the badge
    		BadgeService:AwardBadge(newPlayer.UserId, BADGE_ID)
    local function playerRemoving(oldPlayer)
    	if oldPlayer.UserId == OWNER_ID then
    		-- set ownerInGame to false
    		ownerInGame = false 
    -- listen for players joining and leaving
    -- fire playerAdded for existing players
    for _, player in pairs(Players:GetPlayers()) do