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 8 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 8 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)

1local id = 103728213
2 
3game.Players.PlayerAdded:connect(function(player)
4    if Game:GetService("GamePassService"):PlayerHasPass(player, id) then
5        print(player.Name .. " has the game pass!")
6    else
7        print(player.Name .. " doesn't have the game pass...")
8    end
9end)

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)

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

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 — 8y
Ad
Log in to vote
0
Answered by 8 years ago
Edited 8 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 — 8y

Answer this question