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.
2 comments
01:31:55.501 - MarketplaceService:PromptProductPurchase() player should be of type Player, but is of type ScreenGui is what it said.
Hello. Did I be of any help? Also, thank you for sharing your error. I have never seen this before (also because I don't work with MarketplaceService), so I can't help you if I didn't be of any help. Deeply sorry if that's the case