I've been designing a GUI so that when a person has enough points on the leaderboard he can go into the shop GUI and click the 'buy badge' button that will then award him the badge if they have enough leaderboard points.
01 | local badgeID = 000000 -- replace this with the badge's ID |
02 | local badgeService = game:GetService( "BadgeService" ) |
03 |
04 | -- you can get the player yourself |
05 |
06 | script.Parent.MouseButton 1 Click:Connect( function () -- assuming the script is in the button |
07 | if player.Data.Points.Value > = 1000 then |
08 | badgeService:AwardBadge(player.userId, badgeID) |
09 | end |
10 | end ) |
that should work, if not, oh well, i typed it here. you can look on the wiki and fix it yourself.