mps.Processreceipt is mixing up products

I JUST made a post about this. thought that it worked but guess what… it didnt!
my problem is basically that processreceipt is being really weird and mixing up purchases and stuff. here is the script that handles the actual effects of the devproduct:

local MarketplaceService = game:GetService("MarketplaceService")
local Player = game:GetService('Players')
local ProductID1 = 1672234761 -- Monochrome Invesion
local ProductID2 = 1672360119 -- Color Inversion

MarketplaceService.ProcessReceipt = function(ReceiptInfo)
	if ReceiptInfo.ProductId == ProductID1 then
		workspace.Board.Note.SurfaceGui.TextLabel.Visible = true
		workspace.Board.Note.Transparency = 0
		workspace.Board.Note.CanCollide = true
		workspace.Board.SurfaceGui.Monochrome.Visible = false
		workspace.Board.SurfaceGui["Color Switch"].Visible = false
		workspace.Board.Transparency = 1
		game.Lighting.Monochrome.Enabled = true
		game.Lighting.Monochrome.Saturation = -0.1
		workspace.Board.Board2.Transparency = 0.1
		workspace.Board.Board2.Left.Transparency = 0.1
		workspace.Board.Board2.Right.Transparency = 0.1
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.9
		workspace.Board.Board2.Left.Attachment.ParticleEmitter.Enabled = false
		workspace.Board.Board2.Right.Attachment.ParticleEmitter.Enabled = false
		workspace.Reverse:Play()
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.2
		workspace.Board.Board2.Transparency = 0.2
		workspace.Board.Board2.Left.Transparency = 0.2
		workspace.Board.Board2.Right.Transparency = 0.2
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.8
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.3
		workspace.Board.Board2.Transparency = 0.3
		workspace.Board.Board2.Left.Transparency = 0.3
		workspace.Board.Board2.Right.Transparency = 0.3
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.7
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.4
		workspace.Board.Board2.Transparency = 0.4
		workspace.Board.Board2.Left.Transparency = 0.4
		workspace.Board.Board2.Right.Transparency = 0.4
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.6
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.5
		workspace.Board.Board2.Transparency = 0.5
		workspace.Board.Board2.Left.Transparency = 0.5
		workspace.Board.Board2.Right.Transparency = 0.5
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.5
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.6
		workspace.Board.Board2.Transparency = 0.6
		workspace.Board.Board2.Left.Transparency = 0.6
		workspace.Board.Board2.Right.Transparency = 0.6
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.4
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.7
		workspace.Board.Board2.Transparency = 0.7
		workspace.Board.Board2.Left.Transparency = 0.7
		workspace.Board.Board2.Right.Transparency = 0.7
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.3
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.8
		workspace.Board.Board2.Transparency = 0.8
		workspace.Board.Board2.Left.Transparency = 0.8
		workspace.Board.Board2.Right.Transparency = 0.8
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.2
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.9
		workspace.Board.Board2.Transparency = 0.9
		workspace.Board.Board2.Left.Transparency = 0.9
		workspace.Board.Board2.Right.Transparency = 0.9
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.1
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -1
		workspace.Board.Board2.Transparency = 1
		workspace.Board.Board2.Left.Transparency = 1
		workspace.Board.Board2.Right.Transparency = 1
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0
		wait(3)
		game.Lighting.Monochrome.Saturation = -0.9
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.1
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.8
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.2
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.7
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.3
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.6
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.4
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.5
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.5
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.4
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.6
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.3
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.7
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.2
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.8
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0.1
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.9
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -0
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 1
		game.Lighting.Monochrome.Enabled = false
		wait(0.1)
		game.Lighting.Monochrome.Saturation = -1
		wait(3)
		workspace.Board.Note.SurfaceGui.TextLabel.Visible = false
		workspace.Board.Note.Transparency = 1
		workspace.Board.Note.CanCollide = false
		workspace.Board.SurfaceGui.Monochrome.Visible = true
		workspace.Board.SurfaceGui["Color Switch"].Visible = true
		workspace.Board.Transparency = 0
		workspace.Board.CanCollide = true
		workspace.Board.Board2.Transparency = 0.9
		workspace.Board.Board2.Left.Transparency = 0.9
		workspace.Board.Board2.Right.Transparency = 0.9
		workspace.Board.Board2.Left.Attachment.ParticleEmitter.Enabled = true
		workspace.Board.Board2.Right.Attachment.ParticleEmitter.Enabled = true
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.8
		workspace.Board.Board2.Left.Transparency = 0.8
		workspace.Board.Board2.Right.Transparency = 0.8
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.7
		workspace.Board.Board2.Left.Transparency = 0.7
		workspace.Board.Board2.Right.Transparency = 0.7
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.6
		workspace.Board.Board2.Left.Transparency = 0.6
		workspace.Board.Board2.Right.Transparency = 0.6
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.5
		workspace.Board.Board2.Left.Transparency = 0.5
		workspace.Board.Board2.Right.Transparency = 0.5
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.4
		workspace.Board.Board2.Left.Transparency = 0.4
		workspace.Board.Board2.Right.Transparency = 0.4
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.3
		workspace.Board.Board2.Left.Transparency = 0.3
		workspace.Board.Board2.Right.Transparency = 0.3
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.2
		workspace.Board.Board2.Left.Transparency = 0.2
		workspace.Board.Board2.Right.Transparency = 0.2
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.1
		workspace.Board.Board2.Left.Transparency = 0.1
		workspace.Board.Board2.Right.Transparency = 0.1
		wait(0.1)
		workspace.Board.Board2.Transparency = 0
		workspace.Board.Board2.Left.Transparency = 0
		workspace.Board.Board2.Right.Transparency = 0
	elseif ReceiptInfo.ProductId == ProductID2 then
		workspace.Board.Note.SurfaceGui.TextLabel.Visible = true
		workspace.Board.Note.Transparency = 0
		workspace.Board.Note.CanCollide = true
		workspace.Board.SurfaceGui.Monochrome.Visible = false
		workspace.Board.SurfaceGui["Color Switch"].Visible = false
		workspace.Board.Transparency = 1
		game.Lighting.ColorSwitch.Enabled = true
		game.Lighting.ColorSwitch.Saturation = -0.1
		workspace.Board.Board2.Transparency = 0.1
		workspace.Board.Board2.Left.Transparency = 0.1
		workspace.Board.Board2.Right.Transparency = 0.1
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.9
		workspace.Board.Board2.Left.Attachment.ParticleEmitter.Enabled = false
		workspace.Board.Board2.Right.Attachment.ParticleEmitter.Enabled = false
		workspace.Reverse:Play()
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.2
		workspace.Board.Board2.Transparency = 0.2
		workspace.Board.Board2.Left.Transparency = 0.2
		workspace.Board.Board2.Right.Transparency = 0.2
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.8
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.3
		workspace.Board.Board2.Transparency = 0.3
		workspace.Board.Board2.Left.Transparency = 0.3
		workspace.Board.Board2.Right.Transparency = 0.3
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.7
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.4
		workspace.Board.Board2.Transparency = 0.4
		workspace.Board.Board2.Left.Transparency = 0.4
		workspace.Board.Board2.Right.Transparency = 0.4
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.6
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.5
		workspace.Board.Board2.Transparency = 0.5
		workspace.Board.Board2.Left.Transparency = 0.5
		workspace.Board.Board2.Right.Transparency = 0.5
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.5
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.6
		workspace.Board.Board2.Transparency = 0.6
		workspace.Board.Board2.Left.Transparency = 0.6
		workspace.Board.Board2.Right.Transparency = 0.6
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.4
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.7
		workspace.Board.Board2.Transparency = 0.7
		workspace.Board.Board2.Left.Transparency = 0.7
		workspace.Board.Board2.Right.Transparency = 0.7
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.3
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.8
		workspace.Board.Board2.Transparency = 0.8
		workspace.Board.Board2.Left.Transparency = 0.8
		workspace.Board.Board2.Right.Transparency = 0.8
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.2
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.9
		workspace.Board.Board2.Transparency = 0.9
		workspace.Board.Board2.Left.Transparency = 0.9
		workspace.Board.Board2.Right.Transparency = 0.9
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.1
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1
		workspace.Board.Board2.Transparency = 1
		workspace.Board.Board2.Left.Transparency = 1
		workspace.Board.Board2.Right.Transparency = 1
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.1
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.2
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.3
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.4
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.5
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.6
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.7
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.8
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.9
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -2
		wait(3)
		game.Lighting.ColorSwitch.Saturation = -1.9
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.8
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.7
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.6
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.5
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.4
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.3
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.2
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1.1
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.9
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.1
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.8
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.2
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.7
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.3
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.6
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.4
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.5
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.5
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.4
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.6
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.3
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.7
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.2
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.8
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0.1
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 0.9
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -0
		game.StarterGui.SoundManager.SoundRegions.Sound6.Sound.PlaybackSpeed = 1
		game.Lighting.ColorSwitch.Enabled = false
		wait(0.1)
		game.Lighting.ColorSwitch.Saturation = -1
		wait(3)
		workspace.Board.Note.SurfaceGui.TextLabel.Visible = false
		workspace.Board.Note.Transparency = 1
		workspace.Board.Note.CanCollide = false
		workspace.Board.SurfaceGui.Monochrome.Visible = true
		workspace.Board.SurfaceGui["Color Switch"].Visible = true
		workspace.Board.Transparency = 0
		workspace.Board.CanCollide = true
		workspace.Board.Board2.Transparency = 0.9
		workspace.Board.Board2.Left.Transparency = 0.9
		workspace.Board.Board2.Right.Transparency = 0.9
		workspace.Board.Board2.Left.Attachment.ParticleEmitter.Enabled = true
		workspace.Board.Board2.Right.Attachment.ParticleEmitter.Enabled = true
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.8
		workspace.Board.Board2.Left.Transparency = 0.8
		workspace.Board.Board2.Right.Transparency = 0.8
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.7
		workspace.Board.Board2.Left.Transparency = 0.7
		workspace.Board.Board2.Right.Transparency = 0.7
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.6
		workspace.Board.Board2.Left.Transparency = 0.6
		workspace.Board.Board2.Right.Transparency = 0.6
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.5
		workspace.Board.Board2.Left.Transparency = 0.5
		workspace.Board.Board2.Right.Transparency = 0.5
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.4
		workspace.Board.Board2.Left.Transparency = 0.4
		workspace.Board.Board2.Right.Transparency = 0.4
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.3
		workspace.Board.Board2.Left.Transparency = 0.3
		workspace.Board.Board2.Right.Transparency = 0.3
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.2
		workspace.Board.Board2.Left.Transparency = 0.2
		workspace.Board.Board2.Right.Transparency = 0.2
		wait(0.1)
		workspace.Board.Board2.Transparency = 0.1
		workspace.Board.Board2.Left.Transparency = 0.1
		workspace.Board.Board2.Right.Transparency = 0.1
		wait(0.1)
		workspace.Board.Board2.Transparency = 0
		workspace.Board.Board2.Left.Transparency = 0
		workspace.Board.Board2.Right.Transparency = 0
	end
end

A video of whats going on

please help! anything would be appreciated.

ProcessReceipt will fire multiple times after purchases, which is causing the code to run twice. You should take a look at the callback code example from docs

1 Like

I understand what you are saying and this provided some insight to the reason the code is not working, however I am having some trouble seeing how i can fix my code. thanks for the reply, sorry if i dont understand.