Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Developer Product script what's wrong?

Asked by 10 years ago

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)
0
Also, I have -9 Because I had a really bad time on here ;c iiCasual 20 — 10y
0
I tried that same thing too man. :c Its something that roblox did when releasing 'MarketplaceServce', I think its Server-Sided only. :c TheeDeathCaster 2368 — 10y
0
You didn't define the player variable that you called on line 6. Spongocardo 1991 — 10y

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
10 years ago

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

Ad

Answer this question