If the player has the gamepass id, then I want them to get a weapon but it is not working. When you are in game and you press on the gui button, another gui is suppose to come up saying if you would want to buy it. It does not show up ;(
local Player = game.Players.LocalPlayer local ID = script.Parent.GamePassID.Value local MarketplaceService = game:GetService("MarketplaceService") MarketplaceService.PromptPurchaseFinished:connect(function(Player, ID, isPurchased) if isPurchased then local Weapon = game.ServerStorage['Rocket Launcher'] Weapon:Clone().Parent = Player.Backpack Weapon:Clone().Parent = Player.StarterPack else print(Player.Name.. " does not own the ID of " .. ID) end end)
I know this is kinda late but there might be users with the same question. So all you are doing wrong is you did not actually prompt the purchase and you are directly asking the decision of the purchase. This can be fixed by: SERVER SCRIPT
local Player = game.Players:WaitForChild("FazNook",5) --Player; change this to whatever you are trying to implement (.Touched or .MouseClick etc..) local ID = 3141231 --ID of asset local MarketplaceService = game:GetService("MarketplaceService") MarketplaceService:PromptPurchase(Player,ID) MarketplaceService.PromptPurchaseFinished:connect(function(Player, ID, isPurchased) if isPurchased then local Weapon = game.ServerStorage['Rocket Launcher'] Weapon:Clone().Parent = Player.Backpack Weapon:Clone().Parent = Player.StarterPack else print(Player.Name.. " does not own the ID of " .. ID) end end)
Thank you!