Mannequin purchase script not working

Greetings. I have created a homestore, and on the maneqip the MarketPlaceService will work on ROBLOX Studio Test, but in-game while I have published it won’t come up, my script is:

    local shirtId = 5025650655
    --Prompts the player to purchase the GearItem
    script.Parent.ClickDetector.MouseClick:connect(function(player)
    	Game:GetService("MarketplaceService"):PromptPurchase(player, 5025650655)
    end)

Any help would be appreciated.

Use game lowercase, uppercase won’t work unless you define it as a variable.

1 Like

Is your script placed in ServerScriptService?

And you should change line 4 to be like this

game:GetService("MarketplaceService"):PromptPurchase(player.UserId, shirtId)
1 Like

PromptPurchase is passed a Player Instance, not the UserId.

1 Like

Game should be game and connect should be Connect: the former of each of these are deprecated and it’s preferable to use the latter.

@CAP7A1N @ML4Bzero PromptPurchase is not like PromptProductPurchase, it requires a player object, not their userId

@OP (@Lukas_811), do you have any errors? It would also help if you can disclose the script’s context type (whether it is a local or server script) and where it’s parented

1 Like
local MarketPlace = game:GetService("MarketplaceService")
local Player = game.Players.LocalPlayer

--The main code for the ClickDetector
script.Parent.ClickDetector.MouseClick:Connect(function()
      MarketPlace:PromptPurchase(Player, 5025650655)
end)

@Lukas_811 You will need to use PromptPurchase.

1 Like

I don’t have any script errors. Moreover, all the scripts aren’t local scripts.

1 Like

@bacionhairmanfur2 Let me see if it works.

1 Like

If your script isn’t a local script, his code won’t work.

1 Like

Hmm, I expected that, let me test it with a LocalScript.

1 Like
local MarketplaceService = game:GetService("MarketplaceService")

script.Parent.ClickDetector.MouseClick:Connect(function(MouseClick)
	MarketplaceService:PromptPurchase(MouseClick, 5025650655)
end)

serverscript

1 Like

The only thing I still can’t understand is why it works with roblox studio test and whhy noy in-game.

1 Like

Looking at your code, the only 2 problems would be :connect() and Game are deprecated in favor of :Connect() and game.

And you aren’t using your shirtId variable, but that shouldn’t matter, it should still work.

2 Likes

looks like it worked and yes i’m poor :c

1 Like

@seiyakido Woop, and I’m gonna publish it on the shirt, just give me one min.

1 Like

@Lukas_811 Does the Script work?

1 Like

@seiyakido It worked! Thanks so much for your help buddy. <3

1 Like

@bacionhairmanfur2I tried your script, it unfortunately didn’t work.

1 Like

Oh, Ok I just scripted it hand and did not test it.
Lol.

1 Like

@seiyakido Just fixed on all shirts, and it worked! Tysm, for an another tiime.

1 Like