local productId = 322937935 script.Parent.MouseButton1Click:connect(function() local player = script.Parent.Parent.Parent.Parent.Parent game:GetService("MarketplaceService"):PromptProductPurchase(player, productId) end)
This script is meant to have a player buy a gamepass when a GUI TextButton is pressed, but when I press it, it won't work. Can somebody please fix this?
Possibly because your trying to pop up a prompt to a model? That's my guess. Try this
local productId= 322937935 local player = script.Parent.Parent function BuyMe() game:GetService("MarketplaceService"):PromptProductPurchase(player, productId) end game.StarterGui.(LocationOfYourButtonHere).MouseButton1Click:connect(BuyMe)