-- If you do not know how to use this or the GUI, check out my YouTube video tutorial on this. 
-- Replace the 0's with your ID's 
-- Delete what you dont use, besides the first part of the function



game.StarterGui.ResetPlayerGuiOnSpawn = false
old_fog = game.Lighting.FogStart
local MarketplaceService = game:GetService("MarketplaceService")

function getPlayerFromId(id)
	for i,v in pairs(game.Players:GetChildren()) do
		if v.userId == id then
			return v
		end
	end
	return nil
end
 
MarketplaceService.ProcessReceipt = function(receiptInfo)
	local productId = receiptInfo.ProductId
	local playerId = receiptInfo.PlayerId
	local player = getPlayerFromId(playerId)
	local productName 
	
	-- Down below is an example of a Cash boost
	
	-------------------------------------------------------------------
	
	if productId == 0 then
		local cashmoney = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
			if cashmoney then
				cashmoney.Value = cashmoney.Value + 5000
			end
		-------------------------------------------------------------------
	
		-- Down below is an example of a Health boost
		
		-------------------------------------------------------------------
	
		elseif productId == 0 then
		local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name)
		local char = player.Character
		char.Humanoid.MaxHealth = char.Humanoid.MaxHealth + 15
		wait()
		char.Humanoid.Health = char.Humanoid.MaxHealth
		-------------------------------------------------------------------
	
		-- Down below is an example of a WalkSpeed boost
	
		-------------------------------------------------------------------
		elseif productId == 0 then
		local char = player.Character
		if char then
			local human = char:FindFirstChild("Humanoid")
			if human then
				human.WalkSpeed = human.WalkSpeed + 15
			end
		end
		-------------------------------------------------------------------
		
		-- Down below is an example of a gear giver
		
		-------------------------------------------------------------------
		
    	elseif productId == 0 then
		game.ServerStorage.Sword:Clone().Parent=player.Backpack
		
		elseif productId == 0 then
		game.ServerStorage.Sword2:Clone().Parent=player.Backpack  -- Example if you want to make another gear giver, delete the 2 lines if you dont need it
	
		-------------------------------------------------------------------
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted		
end
