Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help with Game Pass GUI?

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)

1 comment

0

Too broad.

2 answers

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

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)

3 comments

1

.... What the hell is that gonna do.

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

0

I dident copy anything, i use this my self?

This discussion is preserved as it was. New answers, comments, and votes are closed.