When you click the button, it's supposed to give you the gamepass with the Id of 4894476 but instead gives you the model with the id of 4894476. How do you make it so you buy the gamepass instead? if you get what I mean.
local productId = 4894476 local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() game:GetService("MarketplaceService"):PromptProductPurchase(player, productId) end)
You need to use :PromptGamePassPurchase()
instead. :PromptProductPurchase()
applies to items in the library and developer products.
local productId = 4894476 local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() game:GetService("MarketplaceService"):PromptGamePassPurchase(player, productId) end)
Resources:
Accept and upvote if this helped!
Since I believe April 2018 they have changed it gamepasses are no longer in library yet there separate thing and no longer a product yet it is a GamePass (why it is now PromptGamePassPurchase
not PromptProductPurchase
) PromptProductPurchase
is purchasing a devproduct.
Here I have changed it:
local productId = 4894476 local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() game:GetService("MarketplaceService"):PromptGamePassPurchase(player, productId) end)