Code not recognizing player owns gamepass

i’m currently trying to make a button that checks if a player owns a game pass and if they do, then they can get bigger than the other players. my issue is that even though i own the game pass, i get a prompt still and an error. no idea what it means.

Code:

script.Parent.MouseButton1Click:Connect(function()        
    if MPS:UserOwnsGamePassAsync(plr.UserId, 678242521) then
        mama:FireServer()
    else
        MPS:PromptGamePassPurchase(plr, 678242521)
    end
end)

Error:
image

thanks,
dza

Do you get any errors or warnings on the console when you run the code?

nothing in the console, only the error that pops up on my screen

Is this script on the server or on the client, and can you show the full script? E.g with variables as well.

this is a local script which is inside of a textbutton

local MPS = game:GetService("MarketplaceService")
local mama = game:GetService("ReplicatedStorage"):WaitForChild("events").mama
local plrs = game:GetService("Players")
local plr = plrs.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()		
	if MPS:UserOwnsGamePassAsync(plr.UserId, 678242521) then
		mama:FireServer()
	else
		MPS:PromptGamePassPurchase(plr, 678242521)
	end
end)

Okay apparently it fixed itself because i just tested it again to see if it worked or not and it works. :skull: Thanks for your help tho

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.