This script is supposed to award a badge when you click on a GUI button called "Claim badge" but it doesn't work...
function onClick()
player = script.Parent.Parent.Parent.Parent.Parent
b = game:GetService("BadgeService")
b:AwardBadge(player.userId,167923795)
end
script.Parent.MouseButton1Click:connect(onClick)
The hierarchy of the GUI is:
Player -- Player Gui ----ScreenGui ------Frame --------TextButton -----------Script
Thanks, MD

1 comment
Are you sure that it is your own badge in the designated place? You checked the Player's badges and it's not there? If the answer to these questions are Yes, then ROBLOX must have broken it. They've made some methods only accessible in a localscript. Try using a local script, with the player variable defined as 'player = game.Players.LocalPlayer'.