Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is it Prompting a Product not a Gamepass?

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

✓ Accepted answer

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

7076297 -- ID

5 comments

0

The rifle is the gamepass. Wdym?

0

Can you explain more clearly please?

0

hello? Help please what does that mean?

0

you can't just say that the Rifl is the gamepass

0

and i know i'm late ;-;

This discussion is preserved as it was. New answers, comments, and votes are closed.