So, I was working on my game Super Spleef and decided to make a gamepass GUI, and so I wrote out the script but when I tested it out, this happened.! 2021-09-26 (2)|690x365
I tried everything to fix it but it did not work. Here is the script I used:
`local productId = 22726185
local player = game.Players.LocalPlayer
local productId = 22726185
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
game:GetService(“MarketplaceService”):PromptGamePassPurchase(player, productId)
end)
The quotation marks are the wrong marks. Whoops.
You can find errors like this by pressing F9 in game, or by looking at the Output window in Studio.
local productId = 22726185
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, productId)
end)
local productId = 22726185
local player = game:GetService("Players").LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, productId)
end)
@parslmonious I recommand using :Connect and not :connect, and to use game:GetService()!