Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is it Prompting a Product not a Gamepass?

Asked by
Rynappel 212 Moderation Voter
4 years ago

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)

1 answer

Log in to vote
-1
Answered by 4 years ago

ts because the id is pointing to a rifle instead of a gamepass

7076297 -- ID

0
The rifle is the gamepass. Wdym? Rynappel 212 — 4y
0
Can you explain more clearly please? Rynappel 212 — 4y
0
hello? Help please what does that mean? Rynappel 212 — 4y
0
you can't just say that the Rifl is the gamepass Luka_Gaming07 534 — 4y
0
and i know i'm late ;-; Luka_Gaming07 534 — 4y
Ad

Answer this question