15 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

BadgeService

Inherits from: Instance → Object

BadgeService provides information and functionality related to badges. Badges are used across the platform to recognize a player's achievements and activity. Upon awarding a badge to a player, it is added to their inventory and displayed on their profile page.

Inherits from: Instance

Memory category: Instances

Tags: NotCreatable, Service

Methods

NameType / ReturnsDescription
BadgeService:AwardBadgebooleanAward a badge to a player given the ID of each.
BadgeService:AwardBadgeAsyncbooleanAward a badge to a player given the ID of each.
BadgeService:CheckUserBadgesAsyncArrayChecks a list of badge IDs against a UserId and returns a list of badge IDs that the player owns.
BadgeService:GetBadgeInfoAsyncDictionaryFetch information about a badge given its ID.
BadgeService:GetUserBadgesAsyncArrayChecks a list of badge IDs against a User and returns, for each badge the player owns, its ID and the date it was awarded.
BadgeService:IsDisabledbooleanReturns whether a given badge is disabled.
BadgeService:IsLegalbooleanDetermines if a given badge is associated with the current game.
BadgeService:UserHasBadgebooleanChecks whether a user has the badge given the Player.UserId and the badge ID.
BadgeService:UserHasBadgeAsyncbooleanChecks whether a player has the badge given the Player.UserId and the badge ID.

Inherited from Instance

NameType / ReturnsDescription
Instance:AddTag()Applies a tag to the instance.
Instance:childrenInstancesReturns an array of the object's children.
Instance:ClearAllChildren()This method destroys all of an instance's children.
Instance:CloneInstanceCreate a copy of an instance and all its descendants, ignoring instances that are not Archivable.
Instance:cloneInstance
Instance:Destroy()Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children.
Instance:destroy()
Instance:FindFirstAncestorInstance?Returns the first ancestor of the Instance whose Instance.Name is equal to the given name.
Instance:FindFirstAncestorOfClassInstance?Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className.
Instance:FindFirstAncestorWhichIsAInstance?Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstChildInstance?Returns the first child of the Instance found with the given name.
Instance:findFirstChildInstance
Instance:FindFirstChildOfClassInstance?Returns the first child of the Instance whose ClassName is equal to the given class name.
Instance:FindFirstChildWhichIsAInstance?Returns the first child of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstDescendantInstance?Returns the first descendant found with the given Instance.Name.
Instance:GetActorActor?Returns the Actor associated with the Instance, if any.
Instance:GetAttributeVariantReturns the value which has been assigned to the given attribute name.
Instance:GetAttributeChangedSignalRBXScriptSignalReturns an event that fires when the given attribute changes.
Instance:GetAttributesDictionaryReturns a dictionary of the instance's attributes.
Instance:GetChildrenInstancesReturns an array containing all of the instance's children.
Instance:getChildrenInstances
Instance:GetDebugIdstringReturns a coded string of the debug ID used internally by Roblox.
Instance:GetDescendantsInstancesReturns an array containing all of the descendants of the instance.
Instance:GetFullNamestringReturns a string describing the instance's ancestry.
Instance:GetStyledVariantReturns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified.
Instance:GetStyledPropertyChangedSignalRBXScriptSignalReturns an event that fires when the given style property changes on the instance.
Instance:GetTagsArrayGets an array of all tags applied to the instance.
Instance:HasTagbooleanCheck whether the instance has a given tag.
Instance:IsAncestorOfbooleanReturns true if an Instance is an ancestor of the given descendant.
Instance:IsDescendantOfbooleanReturns true if an Instance is a descendant of the given ancestor.
Instance:isDescendantOfboolean
Instance:IsPropertyModifiedbooleanReturns true if the value stored in the specified property is not equal to the code-instantiated default.
Instance:QueryDescendantsInstancesReturns an array containing all descendants of the instance that match the selector string.
Instance:Remove()Sets the object's Parent to nil, and does the same for all its descendants.
Instance:remove()
Instance:RemoveTag()Removes a tag from the instance.
Instance:ResetPropertyToDefault()Resets a property to its default value.
Instance:SetAttribute()Sets the attribute with the given name to the given value.
Instance:WaitForChildInstanceReturns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.

Inherited from Object

NameType / ReturnsDescription
Object:GetPropertyChangedSignalRBXScriptSignalGet an event that fires when a given property of the object changes.
Object:IsAbooleanReturns true if an object's class matches or inherits from a given class.
Object:isAboolean

BadgeService:AwardBadge

Deprecated. Use AwardBadgeAsync() instead.

Award a badge to a player given the ID of each.

Parameters

NameTypeDefaultDescription
userIdUserThe Player.UserId of the user the badge is to be awarded to.
badgeIdint64The ID of the badge to be awarded.

Returns

TypeDescription
booleanBoolean of true if the badge was awarded successfully.
FieldValue
tags["Yields","Deprecated"]
securityNone
thread safetyUnsafe
capabilities["AssetManagement"]

BadgeService:AwardBadgeAsync

Grants a Player a badge with the UserId and the badge ID.

In order to successfully award a badge:

Rate limit is 50 + 35 * [number of users] per minute.

Parameters

NameTypeDefaultDescription
userIdUserThe Player.UserId of the user the badge is to be awarded to.
badgeIdint64The ID of the badge to be awarded.

Returns

TypeDescription
booleanBoolean of true if the badge was awarded successfully.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe
capabilities["AssetManagement"]

Code samples: View on Creator Hub (badges---awarding-a-badge).

BadgeService:CheckUserBadgesAsync

Checks a list of badge IDs against a UserId and returns a list of badge IDs that the player owns. This method supports batches of up to 10 badges; use BadgeService:UserHasBadgeAsync() for single badge lookups.

When called from a server script, any UserId can be used. If the user with the target user ID has not recently been in the server, only badge IDs that are associated with the requesting experience will be checked, and any badge IDs that are not associated with the requesting experience will not be included in the response (as if they were not owned).

For users that have recently been in the server, any badges for any experiences can be queried, no matter who created the badge or which experience it is used for.

In a client script (a LocalScript or a Script with RunContext of RunContext.Client), only the UserId of the local user whose client is running the script can be used.

Rate limit is 10 + 5 * [number of players] per minute in each server.

Parameters

NameTypeDefaultDescription
userIdUserThe UserId of the player to check for ownership of the specified badges.
badgeIdsArrayThe list of IDs of the badges to check ownership of. Maximum length of 10.

Returns

TypeDescription
ArrayThe list of badge IDs the given user owns out of the provided badge IDs. Empty if none of the provided badges are owned by the given user. Not guaranteed to be in the same order as the input list. Some badge IDs may be omitted if the user with the target userId has not recently been in the server and the badge IDs are not associated with the requesting experience.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe
capabilities["AssetManagement"]

Code samples: View on Creator Hub (badges---checking-earned-badges-batch).

BadgeService:GetBadgeInfoAsync

This method fetches information about a badge given its ID and returns a dictionary with the following fields:

Key Type Description
Name string The name of the badge.
Description string The description of the badge.
IconImageId int64 The asset ID of the image for the badge.
IsEnabled boolean Indicates whether the badge is available to be awarded.

This method takes a brief moment to load the information from Roblox; repeated calls will cache for a short duration.

Parameters

NameTypeDefaultDescription
badgeIdint64The badge ID of the badge whose information should be fetched.

Returns

TypeDescription
DictionaryA dictionary of information about the specified badge.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe
capabilities["AssetManagement"]

Code samples: View on Creator Hub (getbadgeinfoasync).

BadgeService:GetUserBadgesAsync

Checks a list of badge IDs against a User and returns, for each badge the player owns, a dictionary containing the badge's ID and the date it was awarded. This method supports batches of up to 100 badges; use BadgeService:UserHasBadgeAsync() for single badge lookups.

Each entry in the returned list is a dictionary with the following fields:

Key Type Description
BadgeId int64 The ID of the owned badge.
AwardedDate DateTime The date and time the badge was awarded to the user.

When called from a server script, any User can be used. If the user with the target User has not recently been in the server, only badge IDs that are associated with the requesting experience will be checked, and any badge IDs that are not associated with the requesting experience will not be included in the response (as if they were not owned).

For users that have recently been in the server, any badges for any experiences can be queried, no matter who created the badge or which experience it is used for.

In a client script (a LocalScript or a Script with RunContext of RunContext.Client), only the User of the local user whose client is running the script can be used.

Rate limit is 10 + 5 * [number of players] per minute in each server.

Parameters

NameTypeDefaultDescription
userIdUserThe User of the player to check for ownership of the specified badges.
badgeIdsArrayThe list of IDs of the badges to check ownership of. Maximum length of 100.

Returns

TypeDescription
ArrayA list of dictionaries, one for each badge the given user owns out of the provided badge IDs. Each dictionary contains a BadgeId and an AwardedDate. Empty if none of the provided badges are owned by the given user. Not guaranteed to be in the same order as the input list. Some badge IDs may be omitted if the user with the target User has not recently been in the server and the badge IDs are not associated with the requesting experience.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe
capabilities["AssetManagement"]

Code samples: View on Creator Hub (badges---getting-earned-badges).

BadgeService:IsDisabled

Deprecated. This function is deprecated. Do not use it for new work. Instead, it can be checked by calling BadgeService:GetBadgeInfoAsync() and checking the IsEnabled field.

This function returns whether the badge with the given ID is marked disabled on the Roblox website. A badge can be disabled by its owner on its page on the Roblox website, in the settings sub-menu. When a badge is disabled, this function returns true and the badge can no longer be awarded. A badge may be quickly re-enabled through the same menu.

In Studio, a badge can only be tested if it is disabled. Calling this function with an enabled badge in Studio will return true and produce a warning "Sorry, badges can only be tested if they are disabled on Roblox game servers".

Note that even if a badge is enabled it may not necessarily be awardable (for example if it isn't associated with the current game).

Badges that are associated with special events are a common reason for a badge to be disabled. Often, it is easier to simply disable a badge instead of hard-coding a time check for when some event ends.

Parameters

NameTypeDefaultDescription
badgeIdint64The ID of the badge.

Returns

TypeDescription
booleanTrue if the specified badge is not available to be awarded.
FieldValue
tags["Yields","Deprecated"]
securityNone
thread safetyUnsafe
capabilities["AssetManagement"]

BadgeService:IsLegal

Deprecated. This function is deprecated and will always return true. Do not use it for new work.

This function determines if a given badge is associated with the current game. It returns true if the badge is associated with the current game.

Badges can only be awarded from a place that is part of the game associated with the badge. This means, for example, a developer cannot award a badge associated with another developer's game.

Even if this returns true, a badge may still not be award-able. For example, it may be disabled.

Parameters

NameTypeDefaultDescription
badgeIdint64The badge ID of the badge.

Returns

TypeDescription
booleanTrue if the badge is associated with the current game.
FieldValue
tags["Yields","Deprecated"]
securityNone
thread safetyUnsafe
capabilities["AssetManagement"]

BadgeService:UserHasBadge

Deprecated. This method has been superseded by BadgeService:UserHasBadgeAsync() which should be used for new work instead.

Checks and returns whether a Player owns a badge given their UserId and the badge ID. You can call the function from a server script or a ModuleScript eventually required by one. When calling the method from a client script (a LocalScript or a Script with RunContext of RunContext.Client), it only works for the local user whose client is running the script.

When called from a server script, any UserId can be used. If the user with the target user ID has not recently been in the server, only badge IDs that are associated with the requesting experience will be checked. If the requested badge ID is not associated with the requesting experience and the target user has not recently been in the server, the method behaves as if the badge is not owned.

For users that have recently been in the server, any badge for any experience can be queried, no matter who created the badge or which experience it is used for.

Parameters

NameTypeDefaultDescription
userIdUserThe user ID of the user.
badgeIdint64The badge ID of the badge.

Returns

TypeDescription
booleanTrue if the user has the badge.
FieldValue
tags["Yields","Deprecated"]
securityNone
thread safetyUnsafe
capabilities["AssetManagement"]

BadgeService:UserHasBadgeAsync

Checks and returns whether a Player owns a badge given their UserId and the badge ID. You can call this method from a server script or a ModuleScript eventually required by one. When calling this method from a client script (a LocalScript or a Script with RunContext of RunContext.Client), it only works for the local user whose client is running the script.

When called from a server script, any UserId can be used. If the user with the target user ID has not recently been in the server, only badge IDs that are associated with the requesting experience will be checked. If the requested badge ID is not associated with the requesting experience and the target user has not recently been in the server, the method behaves as if the badge is not owned.

For users that have recently been in the server, any badge for any experience can be queried, no matter who created the badge or which experience it is used for.

Rate limit is 50 + 35 * [number of players] per minute.

Parameters

NameTypeDefaultDescription
userIdUserThe Player.UserId of the player to check for ownership of the specified badge.
badgeIdint64The badge ID of the badge whose ownership will be checked.

Returns

TypeDescription
booleanIndicates if the specified user has the specified badge.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe
capabilities["AssetManagement"]

Code samples: View on Creator Hub (badges---checking-earned-badges).

Properties

Inherited from Instance

NameType / ReturnsDescription
Instance.ArchivablebooleanDetermines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published.
Instance.archivableboolean
Instance.CapabilitiesSecurityCapabilitiesThe set of capabilities allowed to be used for scripts inside this container.
Instance.IsInSandboxbooleanIndicates whether the instance is inside a sandboxed container.
Instance.NamestringA non-unique identifier of the Instance.
Instance.ParentInstanceDetermines the hierarchical parent of the Instance.
Instance.PredictionModePredictionModeReflects the client-side prediction mode applied to the instance under server-authoritative physics.
Instance.RobloxLockedbooleanA deprecated property that used to protect CoreGui objects.
Instance.SandboxedbooleanWhen enabled, the instance can only access abilities in its Capabilities list.
Instance.UniqueIdUniqueIdA unique identifier for the instance.

Inherited from Object

NameType / ReturnsDescription
Object.ClassNamestringA read-only string representing the class this Object belongs to.
Object.classNamestring

Events

Inherited from Instance

NameType / ReturnsDescription
Instance.AncestryChangedFires when the Instance.Parent property of this object or one of its ancestors is changed.
Instance.AttributeChangedFires whenever an attribute is changed on the Instance.
Instance.ChildAddedFires after an object is parented to this Instance.
Instance.childAdded
Instance.ChildRemovedFires after a child is removed from this Instance.
Instance.DescendantAddedFires after a descendant is added to the Instance.
Instance.DescendantRemovingFires immediately before a descendant of the Instance is removed.
Instance.DestroyingFires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy().
Instance.StyledPropertiesChangedFires whenever any style property is changed on the instance, including when a property is set to nil.

Inherited from Object

NameType / ReturnsDescription
Object.ChangedFires immediately after a property of the object changes, with some limitations.