Why is my prompt purchase not working?

My prompt purchase pops up with this picture, but only for the tshirt ones, the gamepasses get prompted perfectly fine, any ideas why?

Screenshot 2024-03-12 172902

Server:

promptEvent:FireClient(loserPlayer)

Local script in starter player:

local RS = game:GetService("ReplicatedStorage")

local event = RS.PromptPurchase

local PlayerService = game:GetService("Players")
local Player = PlayerService.LocalPlayer


event.OnClientEvent:Connect(function()
	for i,v in pairs(Player.PlayerGui.Donation.Frame.itemsScroller:GetChildren()) do
		local debounce = false
		if not (v:IsA("TextButton") or v:IsA("ImageButton")) then continue end
		v.MouseButton1Click:Connect(function()
			if debounce == false then
				local itemId = v.Id.Value
				local itemPrice = v.Price.Value
				local assetType = v.AssetType.Value
				if assetType == "Tshirt" then
					game:GetService("MarketplaceService"):PromptPurchase(Player, itemId)
				elseif assetType == "Gamepass" then
					game:GetService("MarketplaceService"):PromptGamePassPurchase(Player, itemId)
				end
				debounce = true
				task.wait(1)
				debounce = false
			end
		end)
	end
end)

Just a few points.
-Yes the id is correct ( I have checked using print statements)
-When its a gamepass it prompts perfectly fine
-It can’t be to do with the player variable or the remote event since the gamepass works perfectly.

Thanks for any help

1 Like

Are you using the developer marketplace id or the library id?

Can you send the id?

2 Likes

No idea the difference between them so that could be the issue since I cant find any issues with the code.

image
Heres one:
16427305037

image

I tried in my game and it worked.

game.MarketplaceService:PromptPurchase(game.Players.LocalPlayer,16427305037)
2 Likes

Hmm that is strange. The id that is inputted into the prompt purchase is definitely correct so the only other thing i can try is maybe to go out of studio and see if it just works normally? Have you got any other ideas because Ive looked at the code and I don’t really see why it wouldnt work

Do you enabled “ThirdPartSales” in your game?

image

Because if the game owner is a group and the shirt owner is a player or a different group, you need to enable this option on game settings.

1 Like

Yes I have this enabled but just went into a game and it worked perfectly, guessing its a studio issue? Or is it likely theres an issue with my code?

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.