Hello there, I want to make a game where if someone has a VIP game pass it then will run a script, I've tried this before
local marketPlaceService = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local gamePassId = --// I am not acctually going to put my gamepass id here)
if marketPlaceService:UserOwnsGamePassAsync(player, gamePassId) then
print("USER OWNS GAMEPASS")
else
print("USER DOESN'T OWN GAMEPASS")
end
It doesn't work (I PUT MY GAMEPASSID THERE BTW NOT SENDING IT THO)

1 comment
Always check the documentation before proceeding with an API you're unfamiliar with. The asynchronous method of MarketplaceService, "UserOwnsGamePass", requires the UserID token of the Player Object it is verifying the asset to, not the Object itself.