So I have a gamepass and it gives you a tool when you purchase it. You click on the button and it Prompts a Product purhcase not a gamepass purchase. Is there anything wrong which is making it do this? Here is the script:
local mps = game:GetService("MarketplaceService") local gamepass_id = 7076297 script.Parent.MouseButton1Click:connect(function() local player = game.Players.LocalPlayer mps:PromptGamePassPurchase(player, gamepass_id) end) mps.PromptGamePassPurchaseFinished:connect(function(player, id, purchased) if id == gamepass_id and purchased then game.ReplicatedStorage.GiveRifle:FireServer() end end)
And this is the on Fire Server script:
local mps = game:GetService("MarketplaceService") local gamepass_id = 7076297 game.Players.PlayerAdded:Connect(function(player) if mps:UserOwnsGamePassAsync(player.UserId, gamepass_id) then game.ServerStorage.RifleGun:Clone().Parent = player:WaitForChild("Backpack") game.ServerStorage.RifleGun:Clone().Parent = player:WaitForChild("StarterGear") end end) game.ReplicatedStorage.GivePistol.OnServerEvent:connect(function(player) game.ServerStorage.RifleGun:Clone().Parent = player:WaitForChild("Backpack") game.ServerStorage.RifleGun:Clone().Parent = player:WaitForChild("StarterGear") end)
ts because the id is pointing to a rifle instead of a gamepass