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)
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)
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?