I'm trying to make a gamepass, and make it see if the player owns the gamepass, if not then a gamepass will get prompted.
Here is my script (it's a local script):
local gamepassID = 49956565 local MPS = game:GetService('MarketplaceService') local plr = game.Players.LocalPlayer local button = plr.PlayerGui.GamepassShopGUI.MainFrame.TwoTimesClicksFrame.BuyButton button.Activated:Connect(function() if MPS:UserOwnsGamePassAsync(plr, gamepassID) then button.Text = 'You already own the gamepass' else MPS:PromptGamePassPurchase(plr, gamepassID) end end)
The error is on line 8.
Thank you for reading.