Part not Cloning

Soo when i buy the developer product sometimes it doesn’t spawn the model.

script

local MPS = game:GetService("MarketplaceService")

local goldenbox1 = game.ServerStorage:FindFirstChild("GoldenBox1")

MPS.ProcessReceipt = function(receiptInfo)
	if receiptInfo.ProductId == 1095577134 then
		goldenbox1:Clone().Parent = game.Workspace
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

Help1

any ideas?

Does GoldenBox1 exist in ServerStorage?

Sometimes roblox is picky. I would use WaitForChild

1 Like

Is the part definitely there? It looks to me like it’s an issue with the part not cloning it.

When i start the server sometimes it doesn’t clone. Sometimes yes, it exists in server replicated

This is the script inside the button. Like one of those car spawner.

script.Parent.Parent.GoldenBox1.Parent = game.ServerStorage

script.Parent.ClickDetector.MouseClick:Connect(function(mouse)

local clone = script.ScreenGui:Clone()

clone.Parent = mouse.PlayerGui

end)

If the parents changing to ServerStorage in another script then it may be that the script is running faster than when the parent is set to ServerStorage. Also what are both of these scripts, server right?

Ohh, then. Maybe goldenbox1 didn’t exist at the defining point. Soo…

local MPS = game:GetService("MarketplaceService")

MPS.ProcessReceipt = function(receiptInfo)
	if receiptInfo.ProductId == 1095577134 then
                local goldenbox1 = game.ServerStorage:FindFirstChild("GoldenBox1")
		goldenbox1:Clone().Parent = game.Workspace
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

help2 Help3

I think you’re right, let me do MANY tests