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

How would I make a gamepass give the player a pet?

Asked by 8 years ago

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!

1 answer

Log in to vote
0
Answered by 8 years ago
local passId = 0000000 -- change this to your game pass ID.

function isAuthenticated(player) -- checks to see if the player owns your pass
    return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId)
end

game.Players.PlayerAdded:connect(function(plr)
    if isAuthenticated(plr) then
        --Your code and what you want it to do here
    end
end)
0
Thanks! This will help me a lot! Pot8o_Penguin 50 — 8y
0
are this working? User#28973 0 — 5y
Ad

Answer this question