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

Help with Game Pass GUI? [closed]

Asked by 9 years ago

Ok so I have a screen GUI and a text button in it and this is the script I put in the text button:

local adminId = 217525614
script.Parent.MouseButton1Down:connect(function(player)
    Game:GetService("MarketplaceService"):PromptPurchase(player, adminId)
end)
0
Too broad. EzraNehemiah_TF2 3552 — 9y

Closed as Too Broad by DataStore, EzraNehemiah_TF2, and Shawnyg

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 9 years ago

The problem is the "player" in the MouseButton1Down function. Because there are no parameters for MouseButton1Down. MouseButton1Click is actually better to use unless you want them to hold the mouse down. This is a local script. This should work.

local adminId = 217525614
script.Parent.MouseButton1Down:connect(function()
local player = game.Players.LocalPlayer --You can use localplayer only in local scripts.
    game:GetService("MarketplaceService"):PromptProductPurchase(player, adminId)
end)

This script used: LocalPlayer, PromptProductPurchase and MouseButton1Click

Ad
Log in to vote
-3
Answered by 9 years ago

Put this in

local cleanSweepId = 158439152 -- Your Game pass id here! (Made by Animine)

script.Parent.ClickDetector.MouseClick:connect(function(player) Game:GetService("MarketplaceService"):PromptPurchase(player, cleanSweepId) end)

1
.... What the hell is that gonna do. Rep0man 0 — 9y
1
Animine, think before you post an answer. You just copied that off the ROBLOX blog and it's for a brick, not a TextButton Rep0man 0 — 9y
0
I dident copy anything, i use this my self? Animine 0 — 9y