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 10 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:

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

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 10 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.

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

This script used: LocalPlayer, PromptProductPurchase and MouseButton1Click

Ad
Log in to vote
-3
Answered by 10 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 — 10y
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 — 10y
0
I dident copy anything, i use this my self? Animine 0 — 10y