It always worked untill recently...
local id = (DevProductIdHere) script.Parent.MouseButton1Click:connect(function() game.MarketplaceService:PromptProductPurchase(script.Parent.Parent.Parent, id) end)
pls help. Its in game.StarterGui.ShopButton.Frame and then theres shops. idk how to make it work and it worked when i used it in other game (as a single gui tho,) but i wanted to make it in a shop.
I'm not very experienced with MarketplaceService, but something I know is that you're missing GetService()
Read about GetService here
If you're not interested in reading about GetService(), then here is a solution. However, I cannot guarantee that it will work.
local id = (DevProductIdHere) script.Parent.MouseButton1Click:connect(function() game:GetService("MarketplaceService"):PromptProductPurchase(script.Parent.Parent.Parent, id) end)
If it doesn't work, it might be that the script.Parent.Parent.Parent.id
is wrong. You also did a typo here: you wrote a comma "," instead of a period "." in script.Parent.Parent.Parent.id
You also don't use local id
.
Should you remplace it instead of script.Parent.Parent.Parent.id
? I don't know, since I don't know what the "id" used here is.
Next time, also share your error. To find your error: View tab -> Console
Good developing, and hope this answer helped you :) For questions, feel free to comment.