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

BadgeService:UserHasBadge

BadgeService:UserHasBadge

Oct 01 2018, 1:55 AM PST

The below example would print “The user has this badge” if a player joined whom owned an asset with an ID of 123. If the user didn’t own an asset with an ID of 123, it would print “The user does not have this badge.”

local BadgeService = game:GetService("BadgeService")
local BadgeId = 123

game:GetService("Players").PlayerAdded:Connect(function(player)
    if BadgeService:UserHasBadge(player.UserId, BadgeId) then
        print("The user has this badge")
    else
        print("The user does not have this badge")
    end
end)