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

Gamepass service not working in studio testing?

Asked by
trecept 367 Moderation Voter
5 years ago

I'm making a gamepass that gives a tool but whenever I test in studio it wont work I use game:GetService("MarketPlace"):UserOwnsGamePassAsync and PromptGamePassPurchase but neither will work when I test in studio. Is this just a studio glitch or? And the ID is 100% correct because I wrote it wrong on purpose and got an error, but when it's right there is no error it just wont say a player owns the gamepass when they do.

1 answer

Log in to vote
-1
Answered by
Wiscript 622 Moderation Voter
5 years ago
Edited 5 years ago

MarketPlace isn't a service, MarketplaceService is

You can read all about it here

However, for gamepasses, you should use the GamePassService

An example script of this would be

local id = 000000000 -- Set the ID value here

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)

This example is taken from the Wiki, which can be found here

Hope this helps you! If it does, please make sure to accept my answer

0
No, the PlayerHasPass method is broken. User#19524 175 — 5y
Ad

Answer this question