I tried making one and all it does is say "this item is not for sale." How do I make it work? Script Attempt:
local MarketplaceService = game:GetService("MarketplaceService") local button = script.Parent local player = game.Players.LocalPlayer button.MouseButton1Click:Connect(function() MarketplaceService:PromptPurchase(player, (10663110)) end)
Here you used "PromptPurchase." I suggest you use MarketplaceService:PromptGamepassPurchase I have given you the new script for your problem. Please use the added link to learn what I did.
local MarketplaceService = game:GetService("MarketplaceService") local button = script.Parent local player = game.Players.LocalPlayer ID = 10663110 button.MouseButton1Down:Connect(function() MarketplaceService:PromptGamePassPurchase(player, ID) end)
Resources: https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/PromptGamePassPurchase
https://developer.roblox.com/en-us/api-reference/class/MarketplaceService