local CLICK_BLOCK = script.Parent local ITEM_ID = 17982057 -- Your Developer Product ID (e.g. 116824324). If you don't know where you can get your ID, then go to this link: http://pic.supersgames.rf.gd/uploads/manual/devproid.png (ID marked in yellow). local Click = Instance.new("ClickDetector",CLICK_BLOCK) Click.MouseClick:connect(function(p) game:GetService("MarketplaceService"):PromptProductPurchase(p,ITEM_ID) end)
this is a script that is supposed to make it so when a player presses a button a ui will pop up so the player can buy my game pass but the UI won't pop up when you click on it how can we fix this?
And of course, i got this from a tutorial lol
Put a local script in the button and type this
edit: btw if you use a gamepass you made, it wont work for you, use a different gamepass not made by you that you bought so you can test it. if you finish the game, change it back so you can get robux by it
local ID = "0000000" -- add your gamepass ID here script.Parent.EnterProduct.Buy.MouseButton1Click:Connect(function() game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, ID) end)
After purchasing, if you want something to happen by buying it, put this script in StarterGui and make it a local script. (btw idk if you have to put it in StarterGui, thats just what im doing)
local ID = "0000000" -- add your gamepass ID here while wait() do if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players.LocalPlayer.UserId,ID then -- do whatever you want else -- undo it for anti-cheat reasons. example give the player a speed boost, replace it with the regular run speed (16) end end