Game Giving MarketPlaceService Error

So here’s the rundown:

This script is in the Gui

local Market = game:GetService("MarketplaceService")
local id = 1306306067
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
	Market:PromptProductPurchase(player, id)
end)

This script here is in ServerScriptService

local Market = game:GetService("MarketplaceService")

Market.ProcessReciept = function(reciept)
	if reciept.ProductId == 1306306067 then
		local player = game.Players:GetPlayerByUserId(reciept.PlayerId)
		player:LoadCharacter()
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

And then finally, this here is supposed to respawn the character. (Also in ServerScriptService)

local RS = game:GetService("ReplicatedStorage")
local Plrs = game:GetService("Players")
local ScreenGui = RS:WaitForChild("ScreenGui")

local function PlayerDied(Plr)
	local PlrGui = Plr:WaitForChild("PlayerGui")

	local UIClone = ScreenGui:Clone()
	UIClone.Parent = PlrGui

	Plrs.CharacterAutoLoads = false -- Keep in mind that this will toggle for EVERY player in the server
end

local function PlayerAdded(Plr)
	Plr.CharacterAdded:Connect(function(Char)
		local Hum = Char:WaitForChild("Humanoid")

		Hum.Died:Connect(function()
			PlayerDied(Plr)
		end)
	end)
end

Plrs.PlayerAdded:Connect(PlayerAdded)

So the last script somebody posted on the forum because the last script I used had too many problems. My game allows for the purchase but nothing happens.

2 Likes

If you don’t mind, what is the issue here tho?

I get slightly confused :thinking:

Once I buy the developer product, it won’t respawn me like it should.

You spelled Receipt wrong here, that might be the case. Also you should handle the ProcessReceipt in a better way than this. Reference here: MarketplaceService.ProcessReceipt

Ok I’ll take a look, it keeps throwing out: ProcessReciept is not a valid member of MarketplaceService “MarketplaceService” in the Output

1 Like

Alright, I fixed it, thanks for pointing that out lol. Have a blessed day!

1 Like