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)

5 comments
The rifle is the gamepass. Wdym?
Can you explain more clearly please?
hello? Help please what does that mean?
you can't just say that the Rifl is the gamepass
and i know i'm late ;-;