So, I am making a game, and I want to make a gamepass that gives you a pet. For example you open up the shop GUI then buy a gamepass, you then receive a pet that is there every time you lo back on.
I really need to know how to do this, if anyone knows please let me know as soon as possible!
01 | local passId = 0000000 -- change this to your game pass ID. |
02 |
03 | function isAuthenticated(player) -- checks to see if the player owns your pass |
04 | return game:GetService( "MarketplaceService" ):PlayerOwnsAsset(player, passId) |
05 | end |
06 |
07 | game.Players.PlayerAdded:connect( function (plr) |
08 | if isAuthenticated(plr) then |
09 | --Your code and what you want it to do here |
10 | end |
11 | end ) |