Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

How to see if a player has a badge?

Asked by
lucas4114 607 Moderation Voter
10 years ago

So, what code would I use tp see if a player has a badge?

1if --player has badge thingy??? help?
2    --my stuff goes here
3end

1 answer

Log in to vote
5
Answered by
woodengop 1134 Moderation Voter
10 years ago

If you want to see if a player has a badge then we use the UserHasBadge method, Example script:


1Badge=IDHERE
2 
3game.Players.PlayerAdded:connect(function(p)
4    if game:GetService("BadgeService"):UserHasBadge(p.userId, Badge) then
5        --code
6    end
7end)
Ad

Answer this question