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

Whats the difference between GamePassService and MarketPlaceService?

Asked by 7 years ago

I want to know whats the difference between GamePassService and MarketPlaceService. I want to make a gamepass enabled game but I do not know which to choose to use my my gamepass runner.

2 answers

Log in to vote
1
Answered by 7 years ago

GamePassService is used to check whether or not a player owns a gamepass.

Here's an example from the wiki. (http://wiki.roblox.com/index.php?title=API:Class/GamePassService/PlayerHasPass)

local id = 103728213

game.Players.PlayerAdded:connect(function(player)
    if Game:GetService("GamePassService"):PlayerHasPass(player, id) then 
        print(player.Name .. " has the game pass!")
    else
        print(player.Name .. " doesn't have the game pass...")
    end
end)

MarketPlaceService has a few more features, including the ability to prompt users to buy a gamepass. Here's another example from the wiki that prompts all new players to buy Beautiful Hair for Beautiful People. (http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/PromptPurchase)

game.Players.PlayerAdded:connect(function(player)
    game:GetService("MarketplaceService"):PromptPurchase(player, 16630147)
end)

If you want to check if a player own's a gamepass use GamePassService. If you would like to prompt a player to buy a gamepass, or handle any other ingame transactions use MarketPlaceService. You can find more uses for MarketPlaceService here: http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService.

0
I found that :PlayerOwnsAsset() works better. But, I do not care anyhow. theevanegps2 15 — 7y
Ad
Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Use GamePassService, MarketPlaceService is responsible for in-game transactions. The GamePassService is used to check if a player has a gamepass.

0
MarketplaceService works fine with :PlayerOwnsAsset Disillusions 61 — 7y

Answer this question