--[[script.Parent.MouseButton1Click:connect(function()
	p = script.Parent.Parent.Parent.Parent.Parent
	script.Parent.Parent.Visible = false 
	if p.Order.Value == true then
		wait()
		ids = 21341246
game:GetService("MarketplaceService"):PromptProductPurchase(p, ids)
	print('passed.5')
	wait()
	script.Parent.Parent.Parent:Destroy()
		-- setup local variables
end
end)--]]



ID = game.Workspace.McDId.Value

script.Parent.MouseButton1Click:connect(function()
	script.Parent.Parent.Visible = false
	Service = game:GetService('MarketplaceService')
Player = script.Parent.Parent.Parent.Parent.Parent
local s,e = coroutine.resume(coroutine.create(function()
    if Player:findFirstChild("Backpack") then
     if Player:findFirstChild("Backpack") then
       Service.ProcessReceipt = (function(receiptInfo)
        for i,v in pairs(Player.Order:GetChildren()) do
			if v:IsA("BoolValue") then
			game.Lighting[v.Name]:clone().Parent = Player.Backpack
			end
				end
		Player.Order:ClearAllChildren()
		Player.Order.Value = false;
        Service.ProcessReceipt = nil;
		for a,b in pairs(Player.PlayerGui:GetChildren()) do
			if b.Name == "Incomplete" then
				b:Destroy()
			end
		end
       end)
       Service:PromptProductPurchase(Player,ID);
script.Parent.Parent.Parent.Name = "Incomplete"
     end
 end
end))
if not s then Instance.new("Hint",game.Workspace).Text = "Error: "..e end
end)
