I was wondering how you make a badge that, when you reach the amount of strength that is needed. You are awarded that badge.
COMMUNITY QUESTION
How to make a badge that when you reach that amount of strength?
2 answers
local player = game.Players.LocalPlayer
local strength = player.LeaderStats.Strength
local badge = "ID HERE"
local BService = game:GetService("BadgeService")
function AwardBadge(userid, badge)
if not BService:UserHadBadge(userid, badge) then
end
end
strength.Value.Changed:Connect(function()
if strength.Value >= 100 then
AwardBadge(player.userid, badge)
end
end)
Maybe? Hopefully it works. I don't know :|
Replace
function AwardBadge(userid, badge)
if not BService:UserHadBadge(userid, badge) then
end
end
With
if strength >= 100 then
local badgeID = 12312321 -- replace this with the badge's ID
local badgeService = game:GetService("BadgeService")
badgeService:AwardBadge(player.userId, badgeID)
end
Get back to me on ROBLOX https://web.roblox.com/messages/compose?recipientId=167367445
Or go read the ROBLOX wiki about badges http://wiki.roblox.com/index.php?title=Badge if something goes wrong (I read the wiki to get all my knowledge)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Sadly, it didn't work
aaahhhhhhh