BuyCasesEvents.Case1.OnServerEvent:Connect(function(b,V,r,g)if g==true then if b.DataFolder.Points.Value>=V then b.DataFolder.Points.Value-=V print(V)b.Inventory.BatCase1.Value+=1 else MessagesEvents.NotEnoughPoints:FireClient(b)end elseif g==false then if b.DataFolder.Gems.Value>=r then b.DataFolder.Gems.Value-=r print(r)b.Inventory.BatCase1.Value+=1 else MessagesEvents.NotEnoughPoints:FireClient(b)end end end)OpenCasesEvents.OpenCase1.OnServerEvent:Connect(function(b)if b.Inventory.BatCase1.Value>0 then b.Inventory.BatCase1.Value-=1 OpenCasesEvents.OpenCase1:FireClient(b)else MessagesEvents.CaseNotOwned:FireClient(b)end end)


BuyCasesEvents.Case1.OnServerEvent:Connect(function(player, PricePoints, PriceGems, PointsBuy)
	if PointsBuy == true then
		if player.DataFolder.Points.Value >= PricePoints then
			player.DataFolder.Points.Value -= PricePoints
			print(PricePoints)
			--Transaction Completed
			player.Inventory.BatCase1.Value += 1 --Choose the case
		else
			MessagesEvents.NotEnoughPoints:FireClient(player)
		end
	elseif PointsBuy == false then
		if player.DataFolder.Gems.Value >= PriceGems then
			player.DataFolder.Gems.Value -= PriceGems
			print(PriceGems)
			--Transaction Completed
			player.Inventory.BatCase1.Value += 1 --Case
		else
			MessagesEvents.NotEnoughPoints:FireClient(player)
		end

	end
end)

OpenCasesEvents.OpenCase1.OnServerEvent:Connect(function(player)
	if player.Inventory.BatCase1.Value > 0 then
		player.Inventory.BatCase1.Value -= 1
		OpenCasesEvents.OpenCase1:FireClient(player)
	else
		MessagesEvents.CaseNotOwned:FireClient(player)
	end
end)

