How Come This Server Side Skip Stage Is Not Working?

Whenever I purchase the skip stage DevProduct in my game this script doesn’t seem to work. There are no errors apart from the print at the end saying error so all I know is the problem is in the If statement

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

MarketplaceService.ProcessReceipt = function(receiptInfo)
	local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
	if not player then 
		print("Not a player purchasing")
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	
	if receiptInfo.ProdcutId == 1358421415 then 
		print("Player Purchased Skip Stage!")
		player.leaderstats.Stage.Value += 1
		wait(1)
		player:LoadCharacter()
		return Enum.ProductPurchaseDecision.PurchaseGranted
else 
print("error")
	end
end

All help would be appreciated thank you!

1 Like

I believe you misspelled ProductId in the second if statement

MarketplaceService.ProcessReceipt = function(receiptInfo)
	local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
	if not player then 
		print("Not a player purchasing")
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end

	if receiptInfo.ProductId == 1358421415 then 
		print("Player Purchased Skip Stage!")
		player.leaderstats.Stage.Value += 1
		wait(1)
		player:LoadCharacter()
		return Enum.ProductPurchaseDecision.PurchaseGranted
	else 
		print("error")
	end
end
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.