Help me with this bug, please!


I would like to know what’s wrong with this if you would like here is the folder with this information.
Here is the id 8183052087

use
PromptProductPurchase for devproducts
use
PromptGamePassPurchase for GamePass_es

It works, thank you quin2007. So is this the best script possible for this type of a thing?

local GamepassID = 8183052087
local Buttons = script.Parent.Buttons:GetChildren()

for i = 1, #Buttons do

local CurrentChild = Buttions[i]
    if CurrentChild:FindFirstChild("Gamepass") ~= nil then
        game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer.UserId, GamepassID)
    end
end

That’s a more “mindful” loop in a way.

local Id = 25748434

script.Parent.ClickDetector.MouseClick:Connect(function(playerWhoClicked)
    game:GetService("MarketplaceService"):PromptPurchase(playerWhoClicked.UserId, Id)
end

Those all should work. :’)