Learn
Engine Class
BadgeService
Not Creatable
Service

Summary
Methods
AwardBadge(userId: User,badgeId: number):boolean
Deprecated
IsDisabled(badgeId: number):boolean
Deprecated
IsLegal(badgeId: number):boolean
Deprecated
UserHasBadge(userId: User,badgeId: number):boolean
Deprecated
Inherited Members

API Reference
Methods
AwardBadge
Deprecated

AwardBadgeAsync
Yields
Capabilities: AssetManagement
BadgeService:AwardBadgeAsync(
userId:User, badgeId:number
Parameters
userId:User
badgeId:number
Returns
Code Samples
Awarding a Badge
local BadgeService = game:GetService("BadgeService")
local Players = game:GetService("Players")
local BADGE_ID = 0
local function awardBadge(player, badgeId)
-- Fetch badge information
local success, badgeInfo = pcall(function()
return BadgeService:GetBadgeInfoAsync(badgeId)
end)
if success then
-- Confirm that badge can be awarded
if badgeInfo.IsEnabled then
-- Award badge
local awarded, errorMessage = pcall(BadgeService.AwardBadgeAsync, BadgeService, player.UserId, badgeId)
if not awarded then
warn("Error while awarding badge:", errorMessage)
end
end
else
warn("Error while fetching badge info: " .. badgeInfo)
end
end
local function onPlayerAdded(player)
awardBadge(player, BADGE_ID)
end
Players.PlayerAdded:Connect(onPlayerAdded)

CheckUserBadgesAsync
Yields
Capabilities: AssetManagement
BadgeService:CheckUserBadgesAsync(
userId:User, badgeIds:{any}
Parameters
userId:User
badgeIds:{any}
Returns
Code Samples
Checking Earned Badges in Batches
local BadgeService = game:GetService("BadgeService")
local Players = game:GetService("Players")
local badgeIds = { 0000000000, 1111111111, 2222222222 } -- Change this to a list of your badge IDs
local function onPlayerAdded(player)
-- Check if the player has any of the badges
local success, result = pcall(function()
return BadgeService:CheckUserBadgesAsync(player.UserId, badgeIds)
end)
-- If there's an error, issue a warning and exit the function
if not success then
warn("Error while checking if player", player.Name, "has badges:", result)
return
end
local ownedBadgeIds = result
if #ownedBadgeIds == 0 then
print(player.Name, "does not have any of the badges")
else
print(player.Name, "has the following badges:", table.concat(ownedBadgeIds, ", "))
end
end
Players.PlayerAdded:Connect(onPlayerAdded)

GetBadgeInfoAsync
Yields
Capabilities: AssetManagement
BadgeService:GetBadgeInfoAsync(badgeId:number):Dictionary
Parameters
badgeId:number
Returns
Code Samples
Getting Badge Info
local BadgeService = game:GetService("BadgeService")
-- Fetch badge information
local success, result = pcall(function()
return BadgeService:GetBadgeInfoAsync(00000000) -- Change this to desired badge ID
end)
-- Output the information
if success then
print("Badge:", result.Name)
print("Enabled:", result.IsEnabled)
print("Description:", result.Description)
print("Icon:", "rbxassetid://" .. result.IconImageId)
else
warn("Error while fetching badge info:", result)
end

IsDisabled
Deprecated

IsLegal
Deprecated

UserHasBadge
Deprecated

UserHasBadgeAsync
Yields
Capabilities: AssetManagement
BadgeService:UserHasBadgeAsync(
userId:User, badgeId:number
Parameters
userId:User
badgeId:number
Returns
Code Samples
Checking Earned Badges
local BadgeService = game:GetService("BadgeService")
local Players = game:GetService("Players")
local badgeId = 00000000 -- Change this to your badge ID
local function onPlayerAdded(player)
-- Check if the player has the badge
local success, hasBadge = pcall(function()
return BadgeService:UserHasBadgeAsync(player.UserId, badgeId)
end)
-- If there's an error, issue a warning and exit the function
if not success then
warn("Error while checking if player has badge!")
return
end
if hasBadge then
-- Handle player's badge ownership as needed
print(player.Name, "has badge", badgeId)
end
end
-- Connect "PlayerAdded" events to the "onPlayerAdded()" function
Players.PlayerAdded:Connect(onPlayerAdded)

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.