I have a badge awarding script in my game that works in Roblox Studio but not in the game. I've checked to make sure that it's active and it is and I've also disowned my badge and tried getting it again but it didn't work. Here's my script,
local BadgeService = game:GetService("BadgeService") local function awardBadge(player, badgeId) local success, badgeInfo = pcall(function() return BadgeService:GetBadgeInfoAsync(badgeId) end) if success then if badgeInfo.IsEnabled then local awarded, errorMessage = pcall(function() BadgeService:AwardBadge(player.UserId, badgeId) end) if not awarded then warn("Error while awarding badge", errorMessage) end end else warn("Error while getting badge info") end end
When you earn a badge in studio, it is already earned meaning it can not be earned again.
For example, Getting a Level 10 badge in a game. You can't get Level 10 on the same account.
Hope this helped!