Hi, I am currently needing help because I'm scripting a GUI.

I've put this script into a normal script, and in button.


local gamepassid = 5039620 
local player = game.Players.LocalPlayer


function onClick() 
game:GetService("GamePassService"):PromptPurchase(player, gamepassid) 
end

script.Parent.MouseButton1Click:connect(onClick)


I've changed it from "MarketPlaceService" to "GamePassService" because MarketPlace would bring up Models and games not the actual gamepass. Now the button will do nothing.

Help me please.

Here was the past script btw.


local gamepassid = 5039620 
local player = game.Players.LocalPlayer


function onClick() 
game:GetService("MarketPlaceService"):PromptPurchase(player, gamepassid) 
end

script.Parent.MouseButton1Click:connect(onClick)


3 comments

1

put it in a local script

0

I agree with celcinschi and also use :Connect as :connect is deprecated!

0

Still didn't work.