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.
StarterGui
Scripts
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
script.Parent.MouseButton1Click:Connect(function()
Details.BuyButton.GamepassID.Value = GamepassID
Details.ImageLabel.Image = script.Parent.Image
Details.ItemName.Text = ItemName
Details.ItemPrice.Text = ItemPrice.."R$"
Details.ItemDesc.Text = ItemDesc
end)
BuyButton LocalScript
local mps = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local gamepassID = script.Parent.GamepassID
script.Parent.MouseButton1Click:Connect(function()
mps:PromptGamePassPurchase(player, gamepassID)
end)
Video of my issue
I know this was probably hard to understand, so if you have any questiuons let me know!