So I wanted to prompt the player with a purchase right when they join the game but I got this weird error message that is in the title so how do I fix this problem?
Script
local MarketPlaceService = game:GetService("MarketplaceService")
local gamepassID = --whatever my gamepass ID is
local function promptPurchase()
local player = game.Players.LocalPlayer
local hasPass = false
local success, errormessage = pcall(function()
hasPass = MarketPlaceService:UserOwnsGamePassAsync(player.UserId, gamepassID)
end)
if hasPass then
print("player has the pass, can't prompt")
else
MarketPlaceService:PromptGamePassPurchase(player, gamepassID)
end
end
wait(3)
promptPurchase()