Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with GUI Gamepass door script?

Asked by 8 years ago

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

0
Do you own the gamepass/place? If not, look at this: http://wiki.roblox.com/index.php?title=API:Class/Workspace/AllowThirdPartySales darkelementallord 686 — 8y
0
I do own the gamepass and the place turtle2004 167 — 8y
0
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. Wutras 294 — 8y
0
ok i didn't realize that thx turtle2004 167 — 8y

Answer this question