Hello Developers! I am currently scripting a home store for another developer, however, the prompt purchase doesn’t work and an error comes up (see attached). I have tried editing my script multiple times and nothing seems to be working.
local shirtId = – my shirt id
script.Parent.ClickDetector.MouseClick:connect(function(player)
Game:GetService(”MarketplaceService”): PromptPurchase(player, shirtId)
end)
(p.s: I am writing this on mobile, so I am very sorry for any incorrect formatting or mistakes as I am also new to this)
I don’t think this will make a massive difference but try using game:GetService(”MarketplaceService”): PromptPurchase(player, shirtId)
instead of Game:GetService(”MarketplaceService”): PromptPurchase(player, shirtId)
Also could you pass me the Shirt Id?
That id links to the source image, you need to get the actual shirt id. https://www.roblox.com/library/5060147582/split-hair-top is the id you provided
To get the shirt id you first go to the page where you buy the shirt on the ROBLOX website then
You take a look at the url and see the numbers. The numbers represent the id of the shirt.
By the seems of it the ShirtId is 5060147598
When buying something with PromptPurchase there’s still more you need to do. The PromptPurchase brings up that Gui but after that you need to do
local MarketPlaceService = game:GetService("MarketPlaceService")
function GiveShirt(processReciept)
--add the script to give the shirt and stuff make sure you return the purchase as granted
end
MarketPlaceService.ProductPurchaseDecision = GiveShirt
I myself am still new to MarketPlaceService so this may not be the problem and it’s probably what @Sartorra said.