Not prompting purchase

Hello. I’m trying to prompt a purchase when I click the buy button but it’s not working.

So I’ve made a menu with 2 frames, 1 scrolling frame where the user can select a gamepass and 1 normal frame where all the details are.

So I’ve scripted the button so that all info in the detail panel is updated which works fine.

Then I have an IntValue in the scrollingframe gamepass button with the gamepass ID.
Then I have an empty IntValue under the purchase button in the details panel. And I’ve coded it so that the IntValue under the buy button updates as you select the gamepass in the scrolling frame.

And I’ve checked client and server side and the gamepass ID updates under the buy button. But for whatever reason It’s not prompting the purchase.



ScrollingFrame Gamepass Button LocalScript

local GamepassID = script.Parent.GamepassID.Value
local ItemName = script.Parent.ItemName.Value
local ItemPrice = script.Parent.ItemPrice.Value
local ItemDesc = script.Parent.ItemDesc.Value

local Details = script.Parent.Parent.Parent.Details.InsideFrame

	Details.BuyButton.GamepassID.Value = GamepassID
	Details.ImageLabel.Image = script.Parent.Image
	Details.ItemName.Text = ItemName
	Details.ItemPrice.Text = ItemPrice.."R$"
	Details.ItemDesc.Text = ItemDesc

BuyButton LocalScript

local mps = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local gamepassID = script.Parent.GamepassID

	mps:PromptGamePassPurchase(player, gamepassID)

Video of my issue

I know this was probably hard to understand, so if you have any questiuons let me know!

1 Like

Video not working.

Here is the video in a downloadable version:
robloxapp-20240711-0212014.wmv (731.6 KB)

1 Like

, you have to set the value of gamepassId of the buy button on the server, not the client (gamepassid for buy button is not there for some reason). This also directly applies to leaderboard system as changing a value on the client just won’t work

1 Like

Hm, how do i make sure that it’s client-sided?

1 Like


It suddenly started working. I don’t know what i did but it works now.

1 Like