Right, I am making a Gamepass door on studio that will move your character back 10 studs if you do not have the gamepass there is also a TextButton on the door which is a single resized brick and that s where I have the problem. With the Buy button here is the script:
local GamepassId = script.Parent.Parent.Parent.Parent.Parent.Parent.Configuration.GamePassID.Value
script.Parent.MouseButton1Click:connect(function()
local player = game.Players.LocalPlayer
game:GetService("MarketplaceService"):PromptPurchase(player, GamepassId)
end)
GamepassId leads to a configuration folder in the model with a NumberVaue in it containing the gamepass's ID the problem is it won't prompt the purchase
p.s. the buy button is a TextButton inside about 5 textlabels
if you need any more information on the door to answer this question please leave a comment stating what else is needed

4 comments
Do you own the gamepass/place? If not, look at this: http://wiki.roblox.com/index.php?title=API:Class/Workspace/AllowThirdPartySales
I do own the gamepass and the place
You need to change Valu to Value and find another way to get the Player as LocalPlayer only works inside the Player and what I understood was that this TextButton is inside a SurfaceGui inside of a Part.
ok i didn't realize that thx