Purchases mixing up and other things

Hello again. i’m making a little random thing to switch colors and stuff.
my problem is, whenever i try to purchase smthn it just either doesnt work or does the other one, sometimes it does work then when i try to use the other one after it doesnt work or does the same one i just did. probably not following me but heres the scripts.

colorswtich handler (in sss)

local MarketplaceService = game:GetService("MarketplaceService")
local Player = game:GetService('Players')
local ProductID = 1671420758
local MonochromeScript = script.Parent.MonochromeHandler

game.Players.PlayerAdded:Connect(function(Player)
	MarketplaceService.ProcessReceipt = function(ReceiptInfo)
		if ReceiptInfo.ProductId == ProductID 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
			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
			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
			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
			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
			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
			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
			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
			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
			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
			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(60)
			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
			wait(0.1)
			game.Lighting.ColorSwitch.Saturation = -0.8
			wait(0.1)
			game.Lighting.ColorSwitch.Saturation = -0.7
			wait(0.1)
			game.Lighting.ColorSwitch.Saturation = -0.6
			wait(0.1)
			game.Lighting.ColorSwitch.Saturation = -0.5
			wait(0.1)
			game.Lighting.ColorSwitch.Saturation = -0.4
			wait(0.1)
			game.Lighting.ColorSwitch.Saturation = -0.3
			wait(0.1)
			game.Lighting.ColorSwitch.Saturation = -0.2
			wait(0.1)
			game.Lighting.ColorSwitch.Saturation = -0.1
			wait(0.1)
			game.Lighting.ColorSwitch.Saturation = -0
			game.Lighting.ColorSwitch.Enabled = false
			wait(0.1)
			game.Lighting.ColorSwitch.Saturation = -1
			wait(30)
			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
end)

monochrome handler (also in sss)

local MarketplaceService = game:GetService("MarketplaceService")
local Player = game:GetService('Players')
local ProductID = 1671420761
local ColorSwitchScript = script.Parent.ColorSwitchHandler

game.Players.PlayerAdded:Connect(function(Player)
	MarketplaceService.ProcessReceipt = function(ReceiptInfo)
		if ReceiptInfo.ProductId == ProductID 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
			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
			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
			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
			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
			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
			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
			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
			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
			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
			wait(60)
			game.Lighting.Monochrome.Saturation = -0.9
			wait(0.1)
			game.Lighting.Monochrome.Saturation = -0.8
			wait(0.1)
			game.Lighting.Monochrome.Saturation = -0.7
			wait(0.1)
			game.Lighting.Monochrome.Saturation = -0.6
			wait(0.1)
			game.Lighting.Monochrome.Saturation = -0.5
			wait(0.1)
			game.Lighting.Monochrome.Saturation = -0.4
			wait(0.1)
			game.Lighting.Monochrome.Saturation = -0.3
			wait(0.1)
			game.Lighting.Monochrome.Saturation = -0.2
			wait(0.1)
			game.Lighting.Monochrome.Saturation = -0.1
			wait(0.1)
			game.Lighting.Monochrome.Saturation = -0
			game.Lighting.Monochrome.Enabled = false
			wait(0.1)
			game.Lighting.Monochrome.Saturation = -1
			wait(30)
			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
end)

and the script for the actual purchasing respectively.

local ClickDetector = script.Parent.ClickDetector
local MarketplaceService = game:GetService("MarketplaceService")
local ProductId = 1671420758

ClickDetector.MouseClick:Connect(function(player)
	MarketplaceService:PromptProductPurchase(player, ProductId)
end)
local ClickDetector = script.Parent.ClickDetector
local MarketplaceService = game:GetService("MarketplaceService")
local ProductID = 1671420761

ClickDetector.MouseClick:Connect(function(player)
	MarketplaceService:PromptProductPurchase(player, ProductID)
end)

I seriously dont know whats going wrong and any help will be greatly appreciated.

Don’t have a lot of time hence my answer will lack in detail, but:

You can only have ProcessReceipt once in the entire game.
You should have it outside of the PlayerAdded function so it is only connected once. You can get the player from the ReceiptInfo.

Thanks, i will try this and mark ur answer if it works!

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