You can write your topic however you want, but you need to answer these questions:
I’m trying to make a purchase prompt to show up when someone joins the game. There’s an issue of course!! My code is perfectly fine no errors everything prints out my ID is correct, but nothing works still?
I need help! please and thank you
local Players = game.Players
local productID = 1427383861
local MarketplaceService = game:GetService("MarketplaceService")
Players.PlayerAdded:Connect(function(player)
MarketplaceService:PromptProductPurchase(player, 1427383861)
end)
print("Worked")
local Players = game:GetService("Players")
local productID = 1427383861
local MarketplaceService = game:GetService("MarketplaceService")
Players.PlayerAdded:Connect(function(player)
task.wait(0.5)
local hasTheGamePass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, productID)
if hasTheGamePassPass then
print(player.Name.." owns the gamepass")
else
print(player.Name.." doesn't own the gamepass. Prompting purchase.")
MarketplaceService:PromptGamePassPurchase(player, productID)
end
end)
print("Worked")