local assetId = script.Parent.MarketID.Value script.Parent.MouseButton1Down:connect(function() Game:GetService("MarketplaceService"):PromptPurchase(game.Players.LocalPlayer, assetId, false, 2) end)
I have this code inside of the gui to make it be able to buy something but it does not work for some reason.
You need to use a LocalScript for this.