Context
I have a server script which gets a user’s launch data and uses that to send a remote event to the client that joined. From there the game prompts the user to purchase a developer product.
The issue
No prompt appears.
Code
Here’s the code in my local script:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MarketplaceService = game:GetService("MarketplaceService")
local PromptPurchase = ReplicatedStorage:WaitForChild("PromptPurchase")
PromptPurchase.OnClientEvent:Connect(function(ProductID)
print(1) -- prints fine
MarketplaceService:PromptProductPurchase(Players.LocalPlayer, ProductID)
print(2) -- prints fine
end)
Things to note
- Both the server and client scripts are triggering
- The developer product is for sale and was created for this game
- I’ve wrapped the :PromptProductPurchase function in a pcall and it returns success
- This code used to work but for some reason stopped working
- There are no errors in the console
- I’ve looked thoroughly through other posts and my issue still stands
- I’ve tested the code both in-game and in studio
- Both the product ID and the local player print fine
-
Allow HTTP Requests
,Enable Studio Access to API Services
andAllow Third Party Sales
are all enabled in my game - I’ve tried moving the local script to the StarterGui and StarterCharacterScripts from StarterPlayerScripts and I’ve observed nothing different than the usual bug
- I’ve tested the same code in a different game with a different developer product ID (created in the new game) and I’m still getting the same results
- Calling :GetProductInfo returns info about the developer product as expected
Is there something I’m doing wrong since it doesn’t work in any of my games? Is it a Roblox bug since it’s only been happening recently? Please let me know your thoughts and/or similar experiences.