-- Replace "BadgeID" with the ID of the badge you want to check local badgeID = "BadgeID" local player = game.Players.LocalPlayer local badgeService = game:GetService("BadgeService") local imageButton = script.Parent -- Assuming this script is placed inside the ImageButton -- Function to check if the player has the badge local function checkBadge() -- Replace "PlayerUserID" with the player's UserID local hasBadge = badgeService:UserHasBadgeAsync(player.UserId, badgeID) if hasBadge then imageButton.ImageTransparency = 0 -- Revert transparency to normal else imageButton.ImageTransparency = 0.5 -- Darken the ImageButton end end -- Call the function to check the badge initially checkBadge() -- Connect the function to player earning the badge badgeService.UserHasBadgeChanged:Connect(function(userId, badgeId) if userId == player.UserId and badgeId == badgeID then updateTransparency() end end) -- Function to update transparency to 0 when player earns the badge local function updateTransparency() imageButton.ImageTransparency = 0 end