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.
COMMUNITY QUESTION
How to make it so when you press a GUI button with leaderboard stats, you get badge?
1 answer
local badgeID = 000000 -- replace this with the badge's ID
local badgeService = game:GetService("BadgeService")
-- you can get the player yourself
script.Parent.MouseButton1Click:Connect(function() -- assuming the script is in the button
if player.Data.Points.Value >= 1000 then
badgeService:AwardBadge(player.userId, badgeID)
end
end)
that should work, if not, oh well, i typed it here. you can look on the wiki and fix it yourself.
2 comments
0
is that supposed to be a localscript or a script somewhere?
0
inside the button, if you want to get the player easier, localscript.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
This is a helping website, not a request website.
If you are specific on what exactly you want to know how to do {give badge, save date, clicking a gui ) we can help.