Im trying to make a game where you can purchase any gamepass you want by just putting the id in it
whenever i try to purchase something with it says “Your purchase failed because something went wrong” but it works if i dont use a textbox. (this happens in studio and out of studio; this is not my problem or roblox's problem since i can still buy stuff in other games)
the script i use:
local MarketPlaceService = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local textBox = script.Parent.ItemID
local purchaseButton = script.Parent.PurchaseButton
local function purchase()
local gamepassId = tonumber(textBox.Text)
print(gamepassId)
MarketPlaceService:PromptProductPurchase(player, gamepassId)
end
purchaseButton.MouseButton1Click:Connect(purchase)