I want to make a gamepass where if you buy it, once you join the game you are awarded a badge for owning the gamepass, any tips on how to make this possible?
Thank you!
I want to make a gamepass where if you buy it, once you join the game you are awarded a badge for owning the gamepass, any tips on how to make this possible?
Thank you!
local BadgeService = game:GetService("BadgeService")
local MarketplaceService = game:GetService("MarketplaceService")
function PlrJoin(player)
local gamepassid = [YOUR GAMEPASS ID]
local badge_to_award_ID = [ID OF THE BADGE YOU WANT TO AWARD]
local PlayerBoughtThisGamePass = MarketplaceService.UserOwnsGamePassAsync(player.UserId, gamepassid)
if PlayerBoughtThisGamePass == true then
BadgeService:AwardBadge(player.UserId, badge_to_award_ID)
end
end
game.Players.PlayerAdded:Connect(PlrJoin())
i belive that should work
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Thank you so much!