Hello everyone, please let me explain the situation.

I have an obby game that has a skip stage GUI that allows the player to skip a difficult stage with robux. The script was working fine until I decided to add the free model 'Donation Board' by Nitefall. It ended up breaking the skip stage scripts, so I had to re-write those.

Yet even though I had new skip stage scripts, the Donation Board was now broken. I'm completely unsure why.

The free model is on the toolbox if anyone wants to figure it out, and here are my scripts.

local productId1 = 984121685 -- 25
local productId2 = 984121799   -- 100
local productId3 = nil -- none
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function() 
	if game.Players.LocalPlayer.leaderstats.Stage.Value >= 111 then
		print("You are above stage 111")
		game:GetService("MarketplaceService"):PromptProductPurchase(player, productId3)-- Unspecified Product

				elseif game.Players.LocalPlayer.leaderstats.Stage.Value == 70 then
		print("You are on stage 70")
		game:GetService("MarketplaceService"):PromptProductPurchase(player, productId2)
	
				elseif game.Players.LocalPlayer.leaderstats.Stage.Value == 60 then
		print("You are on stage 60")
		game:GetService("MarketplaceService"):PromptProductPurchase(player, productId2)
	
		elseif game.Players.LocalPlayer.leaderstats.Stage.Value == 50 then
		print("You are on stage 50")
		game:GetService("MarketplaceService"):PromptProductPurchase(player, productId2)
	
	elseif game.Players.LocalPlayer.leaderstats.Stage.Value == 40 then
		print("You are on stage 40")
		game:GetService("MarketplaceService"):PromptProductPurchase(player, productId2)
	
	elseif game.Players.LocalPlayer.leaderstats.Stage.Value <= 70 then
		print("You are above stage 0")
		game:GetService("MarketplaceService"):PromptProductPurchase(player, productId1)
		
			elseif game.Players.LocalPlayer.leaderstats.Stage.Value >= 71 then
		print("You are above stage 71")
		game:GetService("MarketplaceService"):PromptProductPurchase(player, productId3)
	end
end)

^ Local script in the GUI

MarketplaceService = game:GetService("MarketplaceService")

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

currency = "Stage"

done = 0

for i=1,#players do
	if players[i].userId == receiptInfo.PlayerId then
		if receiptInfo.ProductId == 984121685 or 984121799 and done == 0 then
			done = 1
			players[i].leaderstats[currency].Value = players[i].leaderstats[currency].Value + 1
			players[i].Character.Humanoid.Health = 0
			done = 0
		end
	end
end
return Enum.ProductPurchaseDecision.PurchaseGranted	
end

^ Server script in Workspace

1 comment

0

I should mention that the scripts above are the old versions that don't work with the 'Donation Board' model