I was wondering how you make a badge reward the person when they reach 2500 strength.
COMMUNITY QUESTION
How do you make a badge reward when you reach like 2500 Strength?
1 answer
To award the badge, you can use the AwardBadge function of BadgeService.
Do this in a Changed event on the player's Strength stat, with an if statement to determine if they have 2500 strength.
In a Script:
local badges = game:GetService("BadgeService")
local badge = 000000 --Your badge
local wantedVal = 2500 --Amount to earn badge
game.Players.PlayerAdded:Connect(function(plr)
local value = plr:WaitForChild("Strength") --The stat
value.Changed:Connect(function(val)
--Don't check if they already own it
if badges:UserHadBadge(plr.UserId,badge) then return end
if val >= wantedVal then --Compare the val
badges:AwardBadge(plr.UserId,badge) --Award the badge
end
end)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
It doesn't work