I made a gui store, but the prompts to purchase the game passes aren’t working. Here’s my script:
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
local frame = script.Parent
local buy =frame.TextButton
buy.MouseButton1Click:Connect(function()
MarketplaceService:PromptGamePassPurchase(localPlayer, 2774205361)
end)
This is a local script inside of a frame, inside of another frame, inside of a screen GUI, inside of Starter GUI. When I try to purchase it, a prompt shows up on my screen saying, “Your purchase failed because something went wrong. Your account has not been charged. Please try again later.”
I don’t know if the issue is with my script or the location of the script, but I don’t know how to fix it. How do I fix this?