Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Developer Product script what's wrong?

It is already Local script

local MarketplaceService = Game:GetService("MarketplaceService")
local buyButton = game.Workspace.BuyButton.SurfaceGui.TextButton
local productId = 21248921
 
buyButton.MouseButton1Click:connect(function()
	MarketplaceService:PromptProductPurchase(player, productId)
end)

3 comments

0

Also, I have -9 Because I had a really bad time on here ;c

0

I tried that same thing too man. :c Its something that roblox did when releasing 'MarketplaceServce', I think its Server-Sided only. :c

0

You didn't define the player variable that you called on line 6.

1 answer

✓ Accepted answer

player is not a globally defined variable in the default environment; you have to access the client's player using game.Players.LocalPlayer

This discussion is preserved as it was. New answers, comments, and votes are closed.