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

Why does this game pass say "This item is not currently for sale. Account not charged."?

I am actually making an Obby. I have a Skip Stage Game Pass. So the real question is clear from the title that after clicking the Game Pass GUI, It says "This item is not currently for sale. Your account has not been charged." Why is this so? How to fix this? And after fixing this issue, will the game pass teleport me to the next level?

I am pasting all the scripts below:

touchHandler script. This script is for when the player touches the next checkpoint, It increases their level and then they spawn on the next checkpoint.

It is as follows:

local Checkpoints = script.Parent

for i,v in pairs(Checkpoints:GetChildren()) do
	if v:IsA("BasePart") then
		v.Touched:Connect(function(hit)
			
			if hit.Parent:FindFirstChild("Humanoid") then
				
				local player = game.Players:GetPlayerFromCharacter(hit.Parent)
				if player then
					if player.leaderstats.Checkpoint.Value < tonumber(v.Name) then
						player.leaderstats.Checkpoint.Value = tonumber(v.Name)
					end
				end
			end
		end)
	end
end

Next script is the Skip Stager script :

MarketplaceService = game:GetService("MarketplaceService")

MarketplaceService.ProcessReceipt = function(receiptInfo)
local players = game.Players:GetPlayers()

local currency = "Checkpoint"

local done = 0

for i=1,#players do
	if players[i].userId == receiptInfo.PlayerId then
		if receiptInfo.ProductId == 8833785 and done == 0 then -- YOUR ID --
			done = 1
			players[i].leaderstats[currency].Value = players[i].leaderstats[currency].Value + 1
			players[i].Character.Humanoid.Health = 0
			done = 0
			for i=1,#players do
				
			end

		end
	end
end
return Enum.ProductPurchaseDecision.PurchaseGranted	
end

The next script is the Clicker script:


for i,v in pairs(script.Parent.Buttons:GetChildren()) do
	v.MouseButton1Down:connect(function()
		if v:FindFirstChild("Gamepass") ~= nil then
			game:GetService("MarketplaceService"):PromptPurchase(game.Players.LocalPlayer, tonumber(v.Name))
		else
			game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, tonumber(v.Name))
		end
	end)
end

And the next script is the skip stage script:

local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild("leaderstats"):FindFirstChild("Checkpoint")
local id = 8833785 -- your id here -- 
local plr = game.Players.LocalPlayer
local maxnumber = 7 -- Max number of stages --
local MP = game:GetService("MarketplaceService")
 
script.Parent.MouseButton1Click:Connect(function()
    print("ye")
    if leaderstats.Value <  maxnumber then
        MP:PromptProductPurchase(plr,id)
        print("purchase sent")
    else
        script.Parent.Text = "You have beat the game"
        wait(1)
        script.Parent.Text = "Skip Stage"
    end
end)

And this is it. After solving the error, I just want to know that will the Game Pass actually skip my stage?

Note: I am using Data Store.

Please help me.

Thanks

2 answers

I think you didn't made your gamepass on sale so that's the problem

2 comments

0

so it's currently off-sale

0

No. It is On Sale and I even restarted Roblox but it still says the same message.

Press on the create button via. www.roblox.com

Go to your game-pass, go on sales and set the game-pass for sale

IMPORTANT NOTE:

Make sure you are not using data-store, It's built-into ROBLOX already.



WHAT YOU LEARNED:

~ Never use data-store while creating game-passes, it's already built-into ROBLOX

~Always make your game-passes for sale like i wrote how to do above

~The create button via. ROBLOX is very essential in creating games.

1 comment

0

I was saying that I used Data-Store in my leaderboard not game pass. And I made my game pass for sale and even restarted Roblox Studio but it sill says the same message.

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