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!
Have it so when the “Purchase” button in my game is pressed, it asks to buy the correct item. -
What is the issue? Include screenshots / videos if possible!
Currently, when I press “Purchase” in game, it asks to buy something completely different, and the one gamepass (Glock-17 forever) says it’s not on sale when it is.
https://gyazo.com/6d128af6bbcbf42d08491bc5de182643
robloxapp-20200519-1327254.wmv (958.6 KB) < Video of it not working.
Here’s the script:
(I know! I need to get out of the habit of using a million .Parent.Parent’s, lol)
script.Parent.Parent.Parent.Parent.Parent.SoundEffects.ClickSound:Play()
end)
script.Parent.MouseEnter:Connect(function()
script.Parent.Parent.Parent.Parent.Parent.SoundEffects.HoverSound:Play()
end)
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local productID = 9508134
local function promptPurchase()
local player = Players.LocalPlayer
MarketplaceService:PromptProductPurchase(player, productID)
end
script.Parent.MouseButton1Click:Connect(promptPurchase)
And here’s the gamepass I’m trying to use with it.
The linked gamepass is the one that say that the pass isn’t on sale, when it is.
The other ones use the same script but display random items such as “Super Cool Baseplate” and “Microwave”