You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to make a gamepass prompt in a script (LocalScript to be more specific) so when a player clicks on a button a product prompt will pop up using the MarketplaceService -
What is the issue? Include screenshots / videos if possible!
I want this to disappear and I want the actual prompt to pop up -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried a lot of solutions I found online but none of them worked. Id is correct, third party sales are on and I do not own the gamepass yet. Code I use is provided below
local MarketplaceService = game:GetService("MarketplaceService")
local ImageId = script.Parent.ImageId
local Price = script.Parent.Price
script.Parent.Frame.TextButton.Text = Price.Value.."R$"
script.Parent.Frame.Frame.ImageLabel.Image = "rbxassetid://"..ImageId.Value
script.Parent:FindFirstChild("Frame").TextButton.Activated:Connect(function(InputObject, ClickCount)
MarketplaceService:PromptProductPurchase(game.Players.LocalPlayer, script.Parent.GamepassId.Value)
end)
Hope anyone can help me.