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

How to make a player get a badge when they get a gamepass?

Asked by 2 years ago

I want to make it so when a player owns a gamepass then they get a badge and the gamepass id is (27455846) and the badge id is (2125977058)

2 answers

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

Use game.Players.Playeradded and do a check if the player possesses the gamepass. If they do then use Badgeservice to award them the badge. If ur still confused il elaborate more An example can be that

local BadgeService = game:GetService("BadgeService")
local MarketService = game:GetService("MarketPlaceService")
game.Players.PlayerAdded:Connect(function(plr)
local Possesessgamepass = MarketService:UserOwnsGamePassAsync(plr.UserId, insert ur game pass id here)
if Possesessgamepass == true then
BadgeSerivce:AwardBadge(plr.UserId, badge you want to award id)
end
end)
Ad

Answer this question