local button = script.Parent
local devid = 441671993
button.MouseButton1Click:Connect(function(player)
game:GetService("MarketplaceService"):PromptPurchase(player, devid)
end)
✓ ANSWER ACCEPTED
PromptPurchase script not giving player a PromptPurchase?
1 answer
✓ Accepted answer
Your script should have "PromptGamepassPurchase" or "PromptProductPurchase" depending on if it is a gamepass or a dev product. Here is your fixed script: Gamepass script:
local button = script.Parent
local devid = 441671993
button.MouseButton1Click:Connect(function(player)
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, devid)
end)
Dev Product:
local button = script.Parent
local devid = 441671993
button.MouseButton1Click:Connect(function(player)
game:GetService("MarketplaceService"):PromptProductPurchase(player, devid)
end)
Accept this answer if it helped you!
1 comment
0
it does work accept it
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
If it's a gamepass, use PromptGamePassPurchase. If it's a dev product, use PromptProductPurchase
i was using that before, thats weird
The MouseButton1Click event has no parameters, so “player” would return nil. Fortunately, you can use game.Players.LocalPlayer instead to get the player, assuming you’re using a local script.