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.
COMMUNITY QUESTION
Gamepass service not working in studio testing?
1 answer
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
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
No, the PlayerHasPass method is broken.