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

IsDisabled

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 using BadgeService/AwardBadge|AwardBadge. A badge may be quickly re-enabled through the same menu.

A dropdown with an option to disable the badge

Parameters

Name Type Default Description

The ID of the badge.

Returns

Return Type Summary

True if the specified badge is not available to be awarded.


Code Samples


[Deprecated] Checking if a Badge is Disabled

If the below were to be ran in offline mode, it would print

Sorry, badges can only be tested if they are disabled on Roblox game
servers

However, if ran in online mode, it would print true/false to the in-game output in the escape menu (or similar).

local BadgeService = game:GetService( "BadgeService" )
print( BadgeService:IsDisabled( 17468517 ) )

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)
    	end
    end